Skip to content
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

fix(ios): unhandled native exceptions should show an error dialog #12721

Merged
merged 4 commits into from
Jun 16, 2021
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
13 changes: 12 additions & 1 deletion iphone/TitaniumKit/TitaniumKit/Sources/API/TiExceptionHandler.m
Original file line number Diff line number Diff line change
Expand Up @@ -156,8 +156,19 @@ - (id)initWithDictionary:(NSDictionary *)dictionary
if (_backtrace == nil) {
_backtrace = [[[dictionary objectForKey:@"stack"] description] copy];
}
_nativeStack = [[dictionary objectForKey:@"nativeStack"] copy];
_dictionaryValue = [dictionary copy];

id nativeStackObject = [dictionary objectForKey:@"nativeStack"];
if (nativeStackObject) {
if ([nativeStackObject isKindOfClass:[NSArray class]]) {
nativeStackObject = [nativeStackObject copy];
jquick-axway marked this conversation as resolved.
Show resolved Hide resolved
} else if ([nativeStackObject isKindOfClass:[NSString class]]) {
nativeStackObject = [[nativeStackObject componentsSeparatedByString:@"\n"] retain];
jquick-axway marked this conversation as resolved.
Show resolved Hide resolved
} else {
nativeStackObject = nil;
}
}
_nativeStack = nativeStackObject;
jquick-axway marked this conversation as resolved.
Show resolved Hide resolved
}
return self;
}
Expand Down