Commit e89cfd2
fix(firebase_core, web): return empty list from apps getter in WASM mode
Fixes #17918
The `apps` getter now checks if the Firebase core module is loaded before
accessing `firebase.apps`. This avoids triggering a JavaScript exception
when Firebase is not initialized, which is more efficient than relying
on exception handling.
This change ensures `Firebase.apps` returns an empty list in both JS and
WASM web builds when called before `Firebase.initializeApp()`.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude Opus 4.5 <[email protected]>1 parent 48e6e17 commit e89cfd2
File tree
2 files changed
+17
-0
lines changed- packages/firebase_core/firebase_core_web
- lib/src
- test
2 files changed
+17
-0
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
227 | 227 | | |
228 | 228 | | |
229 | 229 | | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
230 | 235 | | |
231 | 236 | | |
232 | 237 | | |
| |||
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
39 | 39 | | |
40 | 40 | | |
41 | 41 | | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
42 | 54 | | |
0 commit comments