diff --git a/Tusker/AppDelegate.swift b/Tusker/AppDelegate.swift index 04691144a5..bdfb20e413 100644 --- a/Tusker/AppDelegate.swift +++ b/Tusker/AppDelegate.swift @@ -34,11 +34,10 @@ class AppDelegate: UIResponder, UIApplicationDelegate { let config = PLCrashReporterConfig(signalHandlerType: .BSD, symbolicationStrategy: .all) AppDelegate.crashReporter = PLCrashReporter(configuration: config) - if AppDelegate.crashReporter.hasPendingCrashReport() { - let data = try! AppDelegate.crashReporter.loadPendingCrashReportDataAndReturnError() + if AppDelegate.crashReporter.hasPendingCrashReport(), + let data = try? AppDelegate.crashReporter.loadPendingCrashReportDataAndReturnError(), + let report = try? PLCrashReport(data: data) { AppDelegate.crashReporter.purgePendingCrashReport() - let report = try! PLCrashReport(data: data) - AppDelegate.pendingCrashReport = report }