PrefUI & PrefWindow // Stop force-unwrapping AppDelegate.

This commit is contained in:
ShikiSuen 2022-11-18 16:12:49 +08:00
parent 125d79e551
commit dca93cb6f0
2 changed files with 2 additions and 2 deletions

View File

@ -88,7 +88,7 @@ struct VwrPrefPaneDictionary: View {
PrefMgr.shared.userDataFolderSpecified = newPath
tbxUserDataPathSpecified = PrefMgr.shared.userDataFolderSpecified
BookmarkManager.shared.saveBookmark(for: url)
(NSApp.delegate as! AppDelegate).updateDirectoryMonitorPath()
(NSApp.delegate as? AppDelegate)?.updateDirectoryMonitorPath()
} else {
IMEApp.buzz()
if !bolPreviousFolderValidity {

View File

@ -263,7 +263,7 @@ class CtlPrefWindow: NSWindowController {
if LMMgr.checkIfSpecifiedUserDataFolderValid(newPath) {
PrefMgr.shared.userDataFolderSpecified = newPath
BookmarkManager.shared.saveBookmark(for: url)
(NSApp.delegate as! AppDelegate).updateDirectoryMonitorPath()
(NSApp.delegate as? AppDelegate)?.updateDirectoryMonitorPath()
} else {
IMEApp.buzz()
if !bolPreviousFolderValidity {