mirror of
https://github.com/tristanpenman/valijson.git
synced 2024-12-12 10:13:51 +01:00
Merge pull request #199 from tyler92/stack-overflow-invalid-ref
Fix stack overflow for unresolved references
This commit is contained in:
commit
ad1e184b1c
@ -1040,13 +1040,14 @@ private:
|
||||
resolveThenPopulateSchema(rootSchema, newRootNode, referencedAdapter, subschema, {}, actualJsonPointer,
|
||||
fetchDoc, parentSchema, ownName, docCache, schemaCache);
|
||||
|
||||
} else {
|
||||
} else if (!actualJsonPointer.empty()) {
|
||||
const AdapterType &referencedAdapter =
|
||||
internal::json_pointer::resolveJsonPointer(rootNode, actualJsonPointer);
|
||||
|
||||
// TODO: Need to detect degenerate circular references
|
||||
resolveThenPopulateSchema(rootSchema, rootNode, referencedAdapter, subschema, {}, actualJsonPointer,
|
||||
fetchDoc, parentSchema, ownName, docCache, schemaCache);
|
||||
} else {
|
||||
throwRuntimeError("Cannot resolve reference \"" + jsonRef + "\".");
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user