Skip to content

Commit

Permalink
Ignore FormatException when decrypting and it wasn't encrypted.
Browse files Browse the repository at this point in the history
  • Loading branch information
Lakritzator committed Sep 22, 2015
1 parent cfe8df2 commit 979ec28
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Dapplo.Config/Converters/StringEncryptionTypeConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -171,7 +171,14 @@ public override object ConvertFrom(ITypeDescriptorContext context, System.Global
string valueString = value as string;
if (!string.IsNullOrWhiteSpace(valueString))
{
return Decrypt(valueString);
// Try to decrypt, ignore FormatException
try
{
return Decrypt(valueString);
} catch (FormatException)
{
return valueString;
}
}
if (valueString != null)
{
Expand Down

0 comments on commit 979ec28

Please sign in to comment.