diff --git a/mRemoteV1/Connection/Protocol/ICA/Connection.Protocol.ICA.cs b/mRemoteV1/Connection/Protocol/ICA/Connection.Protocol.ICA.cs index 31ad594d0..7d9c8d243 100644 --- a/mRemoteV1/Connection/Protocol/ICA/Connection.Protocol.ICA.cs +++ b/mRemoteV1/Connection/Protocol/ICA/Connection.Protocol.ICA.cs @@ -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)) { diff --git a/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs b/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs index a9802d9d8..a4547d5af 100644 --- a/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs +++ b/mRemoteV1/Connection/Protocol/VNC/Connection.Protocol.VNC.cs @@ -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