Skip to content

Commit e67c713

Browse files
committed
Address PR feedcback
1 parent cdd74b9 commit e67c713

File tree

1 file changed

+17
-14
lines changed

1 file changed

+17
-14
lines changed

sentry-android-core/src/main/java/io/sentry/android/core/AnrV2Integration.java

Lines changed: 17 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -367,20 +367,23 @@ private byte[] getDumpBytes(final @NotNull InputStream trace) throws IOException
367367

368368
private static boolean hasOnlySystemFrames(final @NotNull SentryEvent event) {
369369
final List<SentryException> exceptions = event.getExceptions();
370-
if (exceptions != null) {
371-
for (final SentryException exception : exceptions) {
372-
final @Nullable SentryStackTrace stacktrace = exception.getStacktrace();
373-
if (stacktrace != null) {
374-
final @Nullable List<SentryStackFrame> frames = stacktrace.getFrames();
375-
if (frames != null && !frames.isEmpty()) {
376-
for (final SentryStackFrame frame : frames) {
377-
if (frame.isInApp() != null && frame.isInApp()) {
378-
return false;
379-
}
380-
final @Nullable String module = frame.getModule();
381-
if (module != null && !AnrCulpritIdentifier.isSystemFrame(frame.getModule())) {
382-
return false;
383-
}
370+
if (exceptions == null || exceptions.isEmpty()) {
371+
// No exceptions means we haven't verified frames - don't apply special fingerprinting
372+
return false;
373+
}
374+
375+
for (final SentryException exception : exceptions) {
376+
final @Nullable SentryStackTrace stacktrace = exception.getStacktrace();
377+
if (stacktrace != null) {
378+
final @Nullable List<SentryStackFrame> frames = stacktrace.getFrames();
379+
if (frames != null && !frames.isEmpty()) {
380+
for (final SentryStackFrame frame : frames) {
381+
if (frame.isInApp() != null && frame.isInApp()) {
382+
return false;
383+
}
384+
final @Nullable String module = frame.getModule();
385+
if (module != null && !AnrCulpritIdentifier.isSystemFrame(frame.getModule())) {
386+
return false;
384387
}
385388
}
386389
}

0 commit comments

Comments
 (0)