Add null check

This commit is contained in:
Noikoio 2018-09-20 19:42:32 -07:00
parent 1fbc9bca7f
commit ee94cfd961

View file

@ -62,7 +62,8 @@ namespace Kerobot.Common
}
// Verify that the specified array is actually an array.
if (valueSrc.Type != JTokenType.Array) throw new ArgumentException("Given list must be a JSON array.");
if (valueSrc != null && valueSrc.Type != JTokenType.Array)
throw new ArgumentException("Given list must be a JSON array.");
FilteredList = new EntityList((JArray)valueSrc, true);
// Verify the same for the exemption list.