Skip to content

Commit 8a7b33c

Browse files
authored
Fix internal integration test. (#791)
1 parent 929f761 commit 8a7b33c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

firebase-firestore/src/androidTest/java/com/google/firebase/firestore/testutil/IntegrationTestUtil.java

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -161,10 +161,11 @@ public static FirebaseFirestoreSettings newTestSettingsWithSnapshotTimestampsEna
161161
}
162162

163163
public static FirebaseApp testFirebaseApp() {
164-
if (FirebaseApp.getInstance(FirebaseApp.DEFAULT_APP_NAME) != null) {
164+
try {
165165
return FirebaseApp.getInstance(FirebaseApp.DEFAULT_APP_NAME);
166+
} catch (IllegalStateException e) {
167+
return FirebaseApp.initializeApp(ApplicationProvider.getApplicationContext(), OPTIONS);
166168
}
167-
return FirebaseApp.initializeApp(ApplicationProvider.getApplicationContext(), OPTIONS);
168169
}
169170

170171
/** Initializes a new Firestore instance that uses the default project. */

0 commit comments

Comments
 (0)