fix: rare crash at launch if the app previously crashed

This commit is contained in:
Louis Pontoise authored and lwouis committed 2020-07-30 20:03:38 +09:00
1 parent 8c1ba9fe23
commit 12c27f137f
1 file changed
+3 -1
+3 -1
View File
@@ -28,7 +28,9 @@ class AppCenterCrash: NSObject, MSCrashesDelegate {
alert.accessoryView = checkbox
let userChoice = alert.runModal()
let id = self.crashButtonIdToUpdate(userChoice, checkbox)
PoliciesTab.crashButtons[id].state = .on
if let buttons = PoliciesTab.crashButtons, buttons.count > id {
buttons[id].state = .on
}
Preferences.set("crashPolicy", String(id))
BackgroundWork.crashReportsQueue.async { MSCrashes.notify(with: userChoice == .alertFirstButtonReturn ? .send : .dontSend) }
} else {