From 109976422226e2a8aa7140a396f2dde70e4689b7 Mon Sep 17 00:00:00 2001 From: Andreas Linde Date: Mon, 26 Nov 2012 19:45:21 +0100 Subject: [PATCH] Call delegate also if a crash was detected but could not be read If PLCrashReporter wrote a crash report, that could not be read, no delegate was fired. That could make the app stay in the start up maintenance screen, if it handles crashes on startup. Though there was no report this ever happened, there is the theoretical chance this could. --- Classes/BITCrashManager.m | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/Classes/BITCrashManager.m b/Classes/BITCrashManager.m index b80fb531a3..bc81f07501 100644 --- a/Classes/BITCrashManager.m +++ b/Classes/BITCrashManager.m @@ -367,8 +367,17 @@ NSString *const kBITCrashManagerStatus = @"BITCrashManagerStatus"; if ([_crashFiles count] > 0) { BITHockeyLog(@"INFO: %i pending crash reports found.", [_crashFiles count]); return YES; - } else + } else { + if (_didCrashInLastSession) { + if (self.delegate != nil && [self.delegate respondsToSelector:@selector(crashManagerWillCancelSendingCrashReport:)]) { + [self.delegate crashManagerWillCancelSendingCrashReport:self]; + } + + _didCrashInLastSession = NO; + } + return NO; + } }