From 47de6905df847f0f13d8de8ef5506e7224bdbb65 Mon Sep 17 00:00:00 2001 From: Dimitrij Date: Mon, 17 Jan 2022 14:53:38 +0000 Subject: [PATCH] add check if xml return empty to address #2122 --- .../ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/mRemoteNG/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs b/mRemoteNG/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs index 88a88921f..58760b9bf 100644 --- a/mRemoteNG/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs +++ b/mRemoteNG/Config/Serializers/ConnectionSerializers/Xml/XmlConnectionsDeserializer.cs @@ -44,6 +44,7 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml public ConnectionTreeModel Deserialize(string xml, bool import) { + if (string.IsNullOrEmpty(xml)) return null; try { LoadXmlConnectionData(xml); @@ -95,9 +96,11 @@ namespace mRemoteNG.Config.Serializers.ConnectionSerializers.Xml { CreateDecryptor(new RootNodeInfo(RootNodeType.Connection)); connections = _decryptor.LegacyFullFileDecrypt(connections); - _xmlDocument = new XmlDocument(); if (connections != "") + { + _xmlDocument = new XmlDocument(); _xmlDocument.LoadXml(connections); + } } private void ValidateConnectionFileVersion()