Skip to content

Commit d3c9376

Browse files
authored
Avoid NPE in AdditionalPropertiesValidator (#424)
additionalPropertiesSchema can be null by some code paths, but preloadJsonSchema assumes it's always non-null.
1 parent 2273b37 commit d3c9376

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/networknt/schema/AdditionalPropertiesValidator.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -108,6 +108,8 @@ public Set<ValidationMessage> validate(JsonNode node, JsonNode rootNode, String
108108

109109
@Override
110110
public void preloadJsonSchema() {
111-
additionalPropertiesSchema.initializeValidators();
111+
if(additionalPropertiesSchema!=null) {
112+
additionalPropertiesSchema.initializeValidators();
113+
}
112114
}
113115
}

0 commit comments

Comments
 (0)