mirror of
https://github.com/Ranchero-Software/NetNewsWire
synced 2026-11-29 00:31:14 +00:00
Make sure window is non-nil before using it — don’t force-unwrap it. Fix #3827.
This commit is contained in:
1 parent
4b7ea6d920
commit
718204e4d8
9 files changed
+48
-19
No files matched your search
@@ -23,10 +23,12 @@ final class AddFolderWindowController : NSWindowController {
|
||||
|
||||
// MARK: - API
|
||||
|
||||
func runSheetOnWindow(_ w: NSWindow) {
|
||||
hostWindow = w
|
||||
hostWindow!.beginSheet(window!) { (returnCode: NSApplication.ModalResponse) -> Void in
|
||||
|
||||
func runSheetOnWindow(_ hostWindow: NSWindow) {
|
||||
guard let window else {
|
||||
return
|
||||
}
|
||||
|
||||
hostWindow.beginSheet(window) { (returnCode: NSApplication.ModalResponse) -> Void in
|
||||
if returnCode == NSApplication.ModalResponse.OK {
|
||||
self.addFolderIfNeeded()
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user