xml cred deserializer now ensures empty strings are used for any missing xml attributes

This commit is contained in:
David Sparer
2017-01-20 10:09:42 -07:00
parent ad5eb7b594
commit eecfe45443

View File

@@ -21,10 +21,10 @@ namespace mRemoteNG.Config.Serializers
var credentials = from element in xdoc.Descendants("Credential")
select new CredentialRecord(Guid.Parse(element.Attribute("Id")?.Value))
{
Title = element.Attribute("Title")?.Value,
Username = element.Attribute("Username")?.Value,
Title = element.Attribute("Title")?.Value ?? "",
Username = element.Attribute("Username")?.Value ?? "",
Password = cryptographyProvider.Decrypt(element.Attribute("Password")?.Value, decryptionKey).ConvertToSecureString(),
Domain = element.Attribute("Domain")?.Value
Domain = element.Attribute("Domain")?.Value ?? ""
};
return credentials;
}