Skip to content

Commit 6d228d2

Browse files
authored
Merge pull request #282 from waizuwolf/bug-fix/config-npe
Add null check in validationContext.getConfig()
2 parents a0e00e1 + 00c8853 commit 6d228d2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ public PatternValidator(String schemaPath, JsonNode schemaNode, JsonSchema paren
4545
if (schemaNode != null && schemaNode.isTextual()) {
4646
pattern = schemaNode.textValue();
4747
try {
48-
compileRegexPattern(pattern, validationContext.getConfig().isEcma262Validator());
48+
compileRegexPattern(pattern, validationContext.getConfig() != null && validationContext.getConfig().isEcma262Validator());
4949
} catch (PatternSyntaxException pse) {
5050
logger.error("Failed to compile pattern : Invalid syntax [" + pattern + "]", pse);
5151
throw pse;

0 commit comments

Comments
 (0)