Skip to content

Commit 9aad55b

Browse files
committed
Double check for events after parsing report data
In the case that event files are found but cannot be read or parsed, we might write a session with no events. To mitigate this, we will double-check to make sure we've parsed the events properly before synthesizing a report file.
1 parent 690d119 commit 9aad55b

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

firebase-crashlytics/src/main/java/com/google/firebase/crashlytics/internal/persistence/CrashlyticsReportPersistence.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -306,6 +306,12 @@ private void synthesizeReport(@NonNull File sessionDirectory, long sessionEndTim
306306
}
307307
}
308308

309+
// b/168902195
310+
if (events.isEmpty()) {
311+
Logger.getLogger().d("Could not parse event files for session " + sessionDirectory.getName());
312+
return;
313+
}
314+
309315
String userId = null;
310316
final File userIdFile = new File(sessionDirectory, USER_FILE_NAME);
311317
if (userIdFile.isFile()) {

0 commit comments

Comments
 (0)