Skip to content

Commit 8dbbb76

Browse files
committed
Add dictionary null check
1 parent da92ac3 commit 8dbbb76

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

functions/src/Internal/FunctionsSerializer.cs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -83,6 +83,10 @@ private static Dictionary<string, object> EncodeDictionary(IDictionary dict)
8383
var newDict = new Dictionary<string, object>();
8484
foreach (DictionaryEntry entry in dict)
8585
{
86+
if (entry.Key == null)
87+
{
88+
throw new ArgumentException("Dictionary keys cannot be null");
89+
}
8690
newDict[entry.Key.ToString()] = Encode(entry.Value);
8791
}
8892
return newDict;

0 commit comments

Comments
 (0)