Skip to content

Commit 33466cf

Browse files
committed
fix(firebase-perf): Add null check for cache value
1 parent 9a0e1a0 commit 33466cf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

firebase-perf/src/main/java/com/google/firebase/perf/config/ConfigResolver.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ private boolean getIsSdkEnabled() {
234234

235235
Boolean newValue = rcValue.get();
236236
// b. Only cache and return this value if it is different from the current value.
237-
if (!deviceCacheValue.isAvailable() || deviceCacheValue.get() != newValue) {
237+
if (deviceCacheValue == null || !deviceCacheValue.isAvailable() || deviceCacheValue.get() != newValue) {
238238
deviceCacheManager.setValue(config.getDeviceCacheFlag(), newValue);
239239
}
240240

@@ -270,7 +270,7 @@ private boolean getIsSdkVersionDisabled() {
270270
// Do not check FRC last fetch status because it is the most recent value device can get.
271271
String newValue = rcValue.get();
272272
// Only cache and return this value if it is different from the current value.
273-
if (!deviceCacheValue.isAvailable() || !deviceCacheValue.get().equals(newValue)) {
273+
if (deviceCacheValue == null || !deviceCacheValue.isAvailable() || !deviceCacheValue.get().equals(newValue)) {
274274
deviceCacheManager.setValue(config.getDeviceCacheFlag(), newValue);
275275
}
276276
return isFireperfSdkVersionInList(newValue);

0 commit comments

Comments
 (0)