Skip to content

Commit d257eb9

Browse files
fix: fall back to old behavior if newer value is nil in core data tracker (#2865)
Co-authored-by: Dhiogo Ramos Brustolin <[email protected]>
1 parent 102f2a6 commit d257eb9

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
### Fixes
66

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

910
## 8.5.0
1011

Sources/Sentry/SentryCoreDataTracker.m

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#import "SentrySDK+Private.h"
1010
#import "SentryScope+Private.h"
1111
#import "SentrySpanProtocol.h"
12+
@import SentryPrivate;
1213
#import "SentryStacktrace.h"
1314
#import "SentryThreadInspector.h"
1415

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

175-
for (NSManagedObject *item in entities) {
176-
NSString *cl = item.entity.name;
176+
for (id item in entities) {
177+
NSString *cl
178+
= ((NSManagedObject *)item).entity.name ?: [SwiftDescriptor getObjectClassName:item];
177179
NSNumber *count = result[cl];
178180
result[cl] = [NSNumber numberWithInt:count.intValue + 1];
179181
}

0 commit comments

Comments
 (0)