Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mRemoteNG/mRemoteNG.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSean Kaim <kmscode@users.noreply.github.com>2018-08-03 17:13:31 +0300
committerSean Kaim <kmscode@users.noreply.github.com>2018-08-03 17:13:31 +0300
commite6f3c2206493466ae23a92434c9041f6a7fd2cec (patch)
treecdd336cbc32939b97434845fdcc80d1588046354
parenta013518eac31cd2606b7f780b1f254b39efa861b (diff)
code clean up / add'l checksv1.76.6
related to #1061
-rw-r--r--mRemoteV1/Config/Putty/PuttySessionsXmingProvider.cs7
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;