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.
@@ -306,6 +306,12 @@ public class CrashlyticsReportPersistence {
}
}
+ // b/168902195
+ if (events.isEmpty()) {
+ Logger.getLogger().d("Could not parse event files for session " + sessionDirectory.getName());
+ return;
+ }
+
String userId = null;
final File userIdFile = new File(sessionDirectory, USER_FILE_NAME);
if (userIdFile.isFile()) {
