Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on May 8, 2026. It is now read-only.

test: Fix distracting NPE from ExampleFirestoreWriteReadTest.tearDown()#1063

Merged
dconeybe merged 1 commit into
mainfrom
dconeybe/SamplesFixExampleFirestoreWriteReadTestTearDownException
Oct 12, 2022
Merged

test: Fix distracting NPE from ExampleFirestoreWriteReadTest.tearDown()#1063
dconeybe merged 1 commit into
mainfrom
dconeybe/SamplesFixExampleFirestoreWriteReadTestTearDownException

Conversation

@dconeybe

Copy link
Copy Markdown
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 subscribe to this conversation on GitHub. Already have an account? Sign in.

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