File tree Expand file tree Collapse file tree 2 files changed +8
-1
lines changed
src/main/java/com/google/firebase/perf/config Expand file tree Collapse file tree 2 files changed +8
-1
lines changed Original file line number Diff line number Diff line change 1
1
# Unreleased
2
+ * [ fixed] Fix IllegalStateException when starting a trace before Firebase initializes.
2
3
* [ changed] Updated protobuf dependency to ` 3.25.5 ` to fix
3
4
[ CVE-2024 -7254] ( https://github.com/advisories/GHSA-735f-pc8j-v9w8 ) .
4
5
Original file line number Diff line number Diff line change @@ -88,7 +88,13 @@ private RemoteConfigManager() {
88
88
@ VisibleForTesting
89
89
@ SuppressWarnings ("FirebaseUseExplicitDependencies" )
90
90
static long getInitialStartupMillis () {
91
- StartupTime startupTime = FirebaseApp .getInstance ().get (StartupTime .class );
91
+ StartupTime startupTime = null ;
92
+ try {
93
+ startupTime = FirebaseApp .getInstance ().get (StartupTime .class );
94
+ } catch (IllegalStateException ex ) {
95
+ // This can happen if you start a trace before Firebase is init
96
+ logger .debug ("Unable to get StartupTime instance." );
97
+ }
92
98
if (startupTime != null ) {
93
99
return startupTime .getEpochMillis ();
94
100
} else {
You can’t perform that action at this time.
0 commit comments