Skip to content

Commit 1e8fc98

Browse files
authored
Merge pull request #56 from romangobrey/bugfix/decrypt_null_values
Decrypt: check for null values to avoid exception on Encoding.UTF8.GetString
2 parents a93015a + fc504f9 commit 1e8fc98

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/EntityFrameworkCore.DataEncryption/Internal/EncryptionConverter.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ private static TModel Decrypt<TInput, TOupout>(TProvider input, IEncryptionProvi
6262
byte[] decryptedRawBytes = encryptionProvider.Decrypt(inputData);
6363
object decryptedData = null;
6464

65-
if (destinationType == typeof(string))
65+
if (decryptedRawBytes != null && destinationType == typeof(string))
6666
{
6767
decryptedData = Encoding.UTF8.GetString(decryptedRawBytes).Trim('\0');
6868
}

0 commit comments

Comments
 (0)