Update DataTableDeserializer.cs

Table allows for null values which must be handled so as not to create an error
This commit is contained in:
ng3727
2019-08-27 15:19:09 +01:00
parent 5cab342c8c
commit 12b4eb64ba

View File

@@ -164,8 +164,9 @@ namespace mRemoteNG.Config.Serializers.MsSql
connectionInfo.RDGatewayPassword = DecryptValue((string)dataRow["RDGatewayPassword"]);
connectionInfo.RDGatewayDomain = (string)dataRow["RDGatewayDomain"];
if (Enum.TryParse((string)dataRow["RdpVersion"], true, out RdpVersion rdpVersion))
connectionInfo.RdpVersion = rdpVersion;
if (!dataRow.IsNull("RdpVersion")) // table allows null values which must be handled
if (Enum.TryParse((string)dataRow["RdpVersion"], true, out RdpVersion rdpVersion))
connectionInfo.RdpVersion = rdpVersion;
connectionInfo.Inheritance.CacheBitmaps = (bool)dataRow["InheritCacheBitmaps"];
connectionInfo.Inheritance.Colors = (bool)dataRow["InheritColors"];