diff --git a/Tusker/AppDelegate.swift b/Tusker/AppDelegate.swift index 04691144..bdfb20e4 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 }