Ray Milkey
Committed by Gerrit Code Review

Fix NPE when a criterion does not specify a type

Change-Id: I79a115308d703ccec9e9c147df42a6a0a5b8d6dd
......@@ -500,7 +500,9 @@ public final class DecodeCriterionCodecHelper {
* @throws IllegalArgumentException if the JSON is invalid
*/
public Criterion decode() {
String type = json.get(CriterionCodec.TYPE).asText();
String type =
nullIsIllegal(json.get(CriterionCodec.TYPE), "Type not specified")
.asText();
CriterionDecoder decoder = decoderMap.get(type);
if (decoder != null) {
......