From 12b4eb64ba4a853fc2f9add6b5334e03be26147a Mon Sep 17 00:00:00 2001 From: ng3727 <50303390+ng3727@users.noreply.github.com> Date: Tue, 27 Aug 2019 15:19:09 +0100 Subject: [PATCH] Update DataTableDeserializer.cs Table allows for null values which must be handled so as not to create an error --- .../ConnectionSerializers/MsSql/DataTableDeserializer.cs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs index 3080593b..c434deab 100644 --- a/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs +++ b/mRemoteV1/Config/Serializers/ConnectionSerializers/MsSql/DataTableDeserializer.cs @@ -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"];