Skip to content

Commit e5453b7

Browse files
committed
CompareType::parseParams - actually allow null values when parsing JSONArray
1 parent 6276356 commit e5453b7

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

api/src/org/labkey/api/data/CompareType.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
import org.jetbrains.annotations.Nullable;
2525
import org.json.JSONArray;
2626
import org.json.JSONException;
27+
import org.json.JSONObject;
2728
import org.junit.Assert;
2829
import org.junit.Test;
2930
import org.labkey.api.collections.CaseInsensitiveHashSet;
@@ -984,7 +985,8 @@ protected static void parseParams(String value, String separator, Collection<Str
984985
JSONArray array = new JSONArray(value);
985986
for (int i = 0; i < array.length(); i++)
986987
{
987-
collection.add(Objects.toString(array.get(i), null));
988+
Object jsonVal = array.get(i);
989+
collection.add(JSONObject.NULL.equals(jsonVal) ? null : Objects.toString(jsonVal));
988990
}
989991
}
990992
catch (JSONException ex)

0 commit comments

Comments
 (0)