Skip to content

fix: crash on non fatal #1371

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Apr 7, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions ios/RNInstabug/InstabugCrashReportingBridge.m
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ + (BOOL)requiresMainQueueSetup
RCT_EXPORT_METHOD(sendJSCrash:(NSDictionary *)stackTrace
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {

dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0ul);
dispatch_async(queue, ^{
[IBGCrashReporting cp_reportFatalCrashWithStackTrace:stackTrace];
Expand All @@ -40,6 +41,14 @@ + (BOOL)requiresMainQueueSetup
userAttributes:(nullable NSDictionary *)userAttributes fingerprint:(nullable NSString *)fingerprint nonFatalExceptionLevel:(IBGNonFatalLevel)nonFatalExceptionLevel
resolver:(RCTPromiseResolveBlock)resolve
rejecter:(RCTPromiseRejectBlock)reject) {

if([fingerprint isKindOfClass:NSNull.class]){
fingerprint = nil;
}

if([userAttributes isKindOfClass:NSNull.class]){
userAttributes = nil;
}
dispatch_queue_t queue = dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_HIGH, 0ul);
dispatch_async(queue, ^{
[IBGCrashReporting cp_reportNonFatalCrashWithStackTrace:stackTrace level:nonFatalExceptionLevel groupingString:fingerprint userAttributes:userAttributes];
Expand Down