Skip to content

Commit 8b2dbfd

Browse files
author
Francesco Zanutto
committed
fixed potential npe
1 parent 69121ad commit 8b2dbfd

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

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

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,10 @@ static JsonSchemaRef getRefSchema(JsonSchema parentSchema, ValidationContext val
6161
// account the current uri of the parent schema.
6262
URI schemaUri = determineSchemaUri(validationContext.getURIFactory(), parentSchema, refUri);
6363
if (schemaUri == null) {
64+
// the URNFactory is optional
65+
if (validationContext.getURNFactory() == null) {
66+
return null;
67+
}
6468
// If the uri dose't determinate try to determinate with urn factory
6569
schemaUri = determineSchemaUrn(validationContext.getURNFactory(), refUri);
6670
if (schemaUri == null) {

0 commit comments

Comments
 (0)