leadpony / jsonp-test-suite

Test Suite for implementations of Jakarta JSON Processing API (JSON-P)
Apache License 2.0
3 stars 2 forks source link

thrown.getMessage() should first check if thrown is null #7

Closed ssilverman closed 3 years ago

ssilverman commented 3 years ago

There are a number of places where thrown is retrieved from the test and then thrown.getMessage() is called. These places should first check for thrown == null to avoid a possible NullPointerException; these cases will result in a test error but should instead result in a failure.

ssilverman commented 3 years ago

Example fix:

doSomethingWith(thrown.getMessage());

becomes:

assertThat(thrown).isNotNull();
doSomethingWith(thrown.getMessage());
leadpony commented 3 years ago

@ssilverman You are right. Could you write a PR for me?