made a few calls to CredentialRecord safer

This commit is contained in:
David Sparer
2017-01-27 09:46:55 -07:00
parent 6e8e1ad74b
commit 21993a4862
2 changed files with 5 additions and 5 deletions

View File

@@ -141,9 +141,9 @@ namespace mRemoteNG.Connection.Protocol.ICA
return;
}
var _user = _Info.CredentialRecord?.Username;
var _pass = _Info.CredentialRecord?.Password;
var _dom = _Info.CredentialRecord?.Domain;
var _user = _Info.CredentialRecord?.Username ?? "";
var _pass = _Info.CredentialRecord?.Password ?? "".ConvertToSecureString();
var _dom = _Info.CredentialRecord?.Domain ?? "";
if (string.IsNullOrEmpty(_user))
{

View File

@@ -162,7 +162,7 @@ namespace mRemoteNG.Connection.Protocol.VNC
_VNC.ConnectComplete += VNCEvent_Connected;
_VNC.ConnectionLost += VNCEvent_Disconnected;
frmMain.clipboardchange += VNCEvent_ClipboardChanged;
if (((int)Force & (int)ConnectionInfo.Force.NoCredentials) != (int)ConnectionInfo.Force.NoCredentials && !string.IsNullOrEmpty(Info.CredentialRecord.Password.ConvertToUnsecureString()))
if (((int)Force & (int)ConnectionInfo.Force.NoCredentials) != (int)ConnectionInfo.Force.NoCredentials && !string.IsNullOrEmpty(Info.CredentialRecord?.Password.ConvertToUnsecureString()))
{
_VNC.GetPassword = VNCEvent_Authenticate;
}
@@ -194,7 +194,7 @@ namespace mRemoteNG.Connection.Protocol.VNC
private string VNCEvent_Authenticate()
{
return Info.CredentialRecord.Password.ConvertToUnsecureString();
return Info.CredentialRecord?.Password.ConvertToUnsecureString() ?? "";
}
#endregion