forked from shadowfacts/Tusker
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)
|
let config = PLCrashReporterConfig(signalHandlerType: .BSD, symbolicationStrategy: .all)
|
||||||
AppDelegate.crashReporter = PLCrashReporter(configuration: config)
|
AppDelegate.crashReporter = PLCrashReporter(configuration: config)
|
||||||
|
|
||||||
if AppDelegate.crashReporter.hasPendingCrashReport() {
|
if AppDelegate.crashReporter.hasPendingCrashReport(),
|
||||||
let data = try! AppDelegate.crashReporter.loadPendingCrashReportDataAndReturnError()
|
let data = try? AppDelegate.crashReporter.loadPendingCrashReportDataAndReturnError(),
|
||||||
|
let report = try? PLCrashReport(data: data) {
|
||||||
AppDelegate.crashReporter.purgePendingCrashReport()
|
AppDelegate.crashReporter.purgePendingCrashReport()
|
||||||
let report = try! PLCrashReport(data: data)
|
|
||||||
|
|
||||||
AppDelegate.pendingCrashReport = report
|
AppDelegate.pendingCrashReport = report
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue