Merge pull request #1551 from ng3727/origin/fix_MsSql_RdpVersion_null

Update DataTableDeserializer.cs handle null values in column RdpVersion
This commit is contained in:
Faryan Rezagholi
2019-08-30 15:35:19 +02:00
committed by GitHub

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"];