Make sure not to process a crash report file that could not be parsed

This commit is contained in:
Andreas Linde 2013-08-17 15:42:15 +02:00
parent 81014659ed
commit 59db07771e

View File

@ -348,6 +348,9 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
// get the startup timestamp from the crash report, and the file timestamp to calculate the timeinterval when the crash happened after startup
BITPLCrashReport *report = [[BITPLCrashReport alloc] initWithData:crashData error:&error];
if (report == nil) {
BITHockeyLog(@"WARNING: Could not parse crash report");
} else {
if ([report.processInfo respondsToSelector:@selector(processStartTime)]) {
if (report.systemInfo.timestamp && report.processInfo.processStartTime) {
_timeintervalCrashInLastSessionOccured = [report.systemInfo.timestamp timeIntervalSinceDate:report.processInfo.processStartTime];
@ -380,6 +383,7 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus";
}
}
}
}
// Purge the report
// mark the end of the routine