Skip to content

Commit

Permalink
fix: fall back to old behavior if newer value is nil in core data tra…
Browse files Browse the repository at this point in the history
…cker (#2865)

Co-authored-by: Dhiogo Ramos Brustolin <[email protected]>
  • Loading branch information
armcknight and brustolin authored Apr 24, 2023
1 parent 102f2a6 commit d257eb9
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
### Fixes

- Ensure the current GPU frame rate is always reported for concurrent transaction profiling metrics (#2929)
- Possible crash in Core Data tracking (#2865)

## 8.5.0

Expand Down
6 changes: 4 additions & 2 deletions Sources/Sentry/SentryCoreDataTracker.m
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
#import "SentrySDK+Private.h"
#import "SentryScope+Private.h"
#import "SentrySpanProtocol.h"
@import SentryPrivate;
#import "SentryStacktrace.h"
#import "SentryThreadInspector.h"

Expand Down Expand Up @@ -172,8 +173,9 @@ - (NSString *)descriptionForOperations:
{
NSMutableDictionary<NSString *, NSNumber *> *result = [NSMutableDictionary new];

for (NSManagedObject *item in entities) {
NSString *cl = item.entity.name;
for (id item in entities) {
NSString *cl
= ((NSManagedObject *)item).entity.name ?: [SwiftDescriptor getObjectClassName:item];
NSNumber *count = result[cl];
result[cl] = [NSNumber numberWithInt:count.intValue + 1];
}
Expand Down

0 comments on commit d257eb9

Please sign in to comment.