File tree Expand file tree Collapse file tree 1 file changed +10
-3
lines changed
packages/firebase_core/firebase_core_web/lib/src Expand file tree Collapse file tree 1 file changed +10
-3
lines changed Original file line number Diff line number Diff line change @@ -200,9 +200,16 @@ class FirebaseCoreWeb extends FirebasePlatform {
200
200
/// Returns all created [FirebaseAppPlatform] instances.
201
201
@override
202
202
List <FirebaseAppPlatform > get apps {
203
- return guardNotInitialized (
204
- () => firebase.apps.map (_createFromJsApp).toList (growable: false ),
205
- );
203
+ try {
204
+ return firebase.apps.map (_createFromJsApp).toList (growable: false );
205
+ } catch (exception) {
206
+ if (exception.toString ().contains ('of undefined' )) {
207
+ // Keeps behavior consistent with other platforms which can access list without initializing app.
208
+ return [];
209
+ } else {
210
+ rethrow ;
211
+ }
212
+ }
206
213
}
207
214
208
215
/// Initializes a new [FirebaseAppPlatform] instance by [name] and [options] and returns
You can’t perform that action at this time.
0 commit comments