KEMBAR78
test: Fix distracting NPE from ExampleFirestoreWriteReadTest.tearDown() by dconeybe · Pull Request #1063 · googleapis/java-firestore · GitHub
Skip to content

Conversation

@dconeybe
Copy link
Contributor

The ExampleFirestoreWriteReadTest.tearDown() method assumes that the static variables firestore and collectionId are not null; however, if setUp() failed with an exception, then these variables are null. In such a case, tearDown() throws a NullPointerException. This NPE is just added noise that distracts from the real issue, that setUp() failed. This PR fixes this noisy NPE by simply performing a null check before using these static variables.

@dconeybe dconeybe added the api: firestore Issues related to the googleapis/java-firestore API. label Oct 12, 2022
@dconeybe dconeybe self-assigned this Oct 12, 2022
@dconeybe dconeybe merged commit 20e6344 into main Oct 12, 2022
@dconeybe dconeybe deleted the dconeybe/SamplesFixExampleFirestoreWriteReadTestTearDownException branch October 12, 2022 15:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

api: firestore Issues related to the googleapis/java-firestore API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants