[NFC] Fix null pointer profiler warning (#125)

This commit is contained in:
Nick Cooke authored and GitHub committed 2024-05-13 13:19:12 -04:00
1 parent 6e27aa51ab
commit d31430281a
2 files changed
+4 -1

No files matched your search

+3
View File
@@ -1,3 +1,6 @@
# Unreleased
- Fix null pointer warning from profiler. (#124)
# v9.4.1 (CocoaPods Only)
- The v9.4.0 podspec did not include the intended dependency range for nanopb
([firebase-ios-sdk/#12477](https://github.com/firebase/firebase-ios-sdk/issues/12477))
@@ -52,7 +52,7 @@ typedef NSDictionary<NSNumber *, NSNumber *> GDTCORDroppedEventCounter;
// If the dropped event counter for this event's mapping ID is `nil`,
// an empty mutable counter is returned.
NSMutableDictionary<NSNumber *, NSNumber *> *eventCounter =
[NSMutableDictionary dictionaryWithDictionary:eventCounterByLogSource[event.mappingID]];
[NSMutableDictionary dictionaryWithDictionary:eventCounterByLogSource[event.mappingID] ?: @{}];
// Increment the log source metrics for the given reason.
NSInteger currentEventCountForReason = [eventCounter[@(reason)] integerValue];