fix return the wrong value

This commit is contained in:
2021-03-25 13:24:04 +01:00
parent 6871d6952f
commit 3376fecd12
3 changed files with 20 additions and 17 deletions

View File

@@ -22,12 +22,13 @@ namespace Pilz.Json.Converters
var idString = serializer.Deserialize<string>(reader);
SecureString id;
if (existingValue is object)
if (existingValue is SecureString)
{
id = (SecureString)existingValue;
id.EncryptedValue = idString;
}
else
id = new SecureString();
id.EncryptedValue = idString;
id = new SecureString(idString, true);
return id;
}