Check criteria

This commit is contained in:
Xavi Aracil 2023-10-03 10:55:09 -04:00
parent be3ebb1231
commit 0576a036f6

View File

@ -95,7 +95,7 @@ public class CredentialSubjectProbe extends Probe<JsonNode> {
}
// criteria must have id or narrative
JsonNode criteria = achievement.get("criteria");
if (!criteria.has("id") && !criteria.has("narrative")) {
if (!criteria.hasNonNull("id") && !criteria.hasNonNull("narrative")) {
return error("criteria in achievement of credentialSubject must have id or narrative", ctx);
}
} else if (achivementRequired) {