add check if xml return empty to address #2122

This commit is contained in:
Dimitrij
2022-01-17 14:53:38 +00:00
parent c055f8069d
commit 47de6905df

View File

@@ -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()