Fix crash if getting pending crash report fails
This commit is contained in:
parent
4f99d3c6e1
commit
a718721537
|
@ -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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue