Skip to content

Getting NPE when passing null to validate method. #376

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
rahul22048 opened this issue Jul 2, 2021 · 0 comments
Open

Getting NPE when passing null to validate method. #376

rahul22048 opened this issue Jul 2, 2021 · 0 comments

Comments

@rahul22048
Copy link

below is the code snippet:-

final JsonSchemaFactory factory = JsonSchemaFactory.byDefault();
final JsonNode node = JsonLoader.fromResource("/json-patch.json");
SCHEMA = factory.getJsonSchema(node);

in another method, i use it like this:-

ProcessingReport report = SCHEMA.validate(patchJson);

NPE exception comes when patchJson is passed as null.

for reference json-patch.json is same as the one here:- https://github.com/fge/json-schema-processor-examples/blob/master/src/main/resources/json-patch.json

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant