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

temporary solution checking if frames exists before extracting the value #743

Merged
merged 1 commit into from
Jan 27, 2020
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
18 changes: 11 additions & 7 deletions android/src/main/java/io/sentry/RNSentryModule.java
Original file line number Diff line number Diff line change
Expand Up @@ -317,13 +317,17 @@ public void sendEvent(ReadableMap event, Promise promise) {
ReadableNativeMap exception = exceptionValues.getMap(0);
if (exception.hasKey("stacktrace")) {
ReadableNativeMap stacktrace = exception.getMap("stacktrace");
ReadableNativeArray frames = (ReadableNativeArray)stacktrace.getArray("frames");
if (exception.hasKey("value")) {
addExceptionInterface(eventBuilder, exception.getString("type"), exception.getString("value"), frames);
} else {
// We use type/type here since this indicates an Unhandled Promise Rejection
// https://github.com/getsentry/react-native-sentry/issues/353
addExceptionInterface(eventBuilder, exception.getString("type"), exception.getString("type"), frames);
// temporary solution until final fix
// https://github.com/getsentry/sentry-react-native/issues/742
if (stacktrace.hasKey("frames")) {
ReadableNativeArray frames = (ReadableNativeArray)stacktrace.getArray("frames");
if (exception.hasKey("value")) {
addExceptionInterface(eventBuilder, exception.getString("type"), exception.getString("value"), frames);
} else {
// We use type/type here since this indicates an Unhandled Promise Rejection
// https://github.com/getsentry/react-native-sentry/issues/353
addExceptionInterface(eventBuilder, exception.getString("type"), exception.getString("type"), frames);
}
}
}
}
Expand Down