Skip to content

Commit fc504f9

Browse files
committed
Fix: provider might return null (for decryptedRawBytes variable) when decryption data which leads to an exception here -- decryptedData = Encoding.UTF8.GetString(decryptedRawBytes).Trim('\0');
1 parent ea6836b commit fc504f9

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)