Skip to content

Commit 8fe7eb7

Browse files
committed
feat: add StringEncryptionParameters null checks
1 parent aea85a6 commit 8fe7eb7

1 file changed

Lines changed: 23 additions & 0 deletions

File tree

src/Helpers/Validators.cs

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,5 +37,28 @@ public static void ValidateNotNull(ByteEncryptionParameters parameters)
3737
throw new ArgumentNullException(nameof(parameters.IV), "IV property cannot be null.");
3838
}
3939
}
40+
41+
public static void ValidateNotNull(StringEncryptionParameters parameters)
42+
{
43+
if (parameters == null)
44+
{
45+
throw new ArgumentNullException(nameof(parameters), "StringEncryptionParameters instance cannot be null.");
46+
}
47+
48+
if (parameters.Data == null)
49+
{
50+
throw new ArgumentNullException(nameof(parameters.Data), "Data property cannot be null.");
51+
}
52+
53+
if (parameters.SecretKey == null)
54+
{
55+
throw new ArgumentNullException(nameof(parameters.SecretKey), "SecretKey property cannot be null.");
56+
}
57+
58+
if (parameters.IV == null)
59+
{
60+
throw new ArgumentNullException(nameof(parameters.IV), "IV property cannot be null.");
61+
}
62+
}
4063
}
4164
}

0 commit comments

Comments
 (0)