diff options
author | Sean Kaim <kmscode@users.noreply.github.com> | 2018-08-03 17:13:31 +0300 |
---|---|---|
committer | Sean Kaim <kmscode@users.noreply.github.com> | 2018-08-03 17:13:31 +0300 |
commit | e6f3c2206493466ae23a92434c9041f6a7fd2cec (patch) | |
tree | cdd336cbc32939b97434845fdcc80d1588046354 | |
parent | a013518eac31cd2606b7f780b1f254b39efa861b (diff) |
code clean up / add'l checksv1.76.6
related to #1061
-rw-r--r-- | mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs b/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs index e418c0bf..4b99a02a 100644 --- a/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs +++ b/mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs @@ -33,6 +33,7 @@ namespace mRemoteNG.Config.Putty foreach (var sessionName in Directory.GetFiles(sessionsFolderPath)) { var sessionFileName = Path.GetFileName(sessionName); + // ReSharper disable once ConstantConditionalAccessQualifier sessionNames.Add(raw ? sessionFileName : System.Web.HttpUtility.UrlDecode(sessionFileName?.Replace("+", "%2B"))); } @@ -174,7 +175,8 @@ namespace mRemoteNG.Config.Putty private static string GetPuttyConfPath() { var puttyPath = mRemoteNG.Settings.Default.UseCustomPuttyPath ? mRemoteNG.Settings.Default.CustomPuttyPath : App.Info.GeneralAppInfo.PuttyPath; - return Path.Combine(Path.GetDirectoryName(puttyPath), "putty.conf"); + puttyPath = Path.GetDirectoryName(puttyPath); + return string.IsNullOrEmpty(puttyPath) ? null : Path.Combine(puttyPath, "putty.conf"); } private static string GetSessionsFolderPath() @@ -201,6 +203,9 @@ namespace mRemoteNG.Config.Putty private static PuttySessionInfo ModifyRegistrySessionInfo(PuttySessionInfo sessionInfo) { + if (sessionInfo == null) + return null; + sessionInfo.Name = string.Format(RegistrySessionNameFormat, sessionInfo.Name); sessionInfo.PuttySession = string.Format(RegistrySessionNameFormat, sessionInfo.PuttySession); return sessionInfo; |