Replace force-unwraps

Fix for #2513.
This commit is contained in:
Nate Weaver 2020-10-20 12:02:27 -05:00
parent 42fdcc91e6
commit d504a4b1a8

View File

@ -202,10 +202,12 @@ private extension GeneralPreferencesViewController {
menu.addItem(NSMenuItem.separator())
for browser in allBrowsers {
let item = NSMenuItem(title: browser.name!, action: nil, keyEquivalent: "")
guard let name = browser.name else { continue }
let item = NSMenuItem(title: name, action: nil, keyEquivalent: "")
item.representedObject = browser.bundleIdentifier
let icon = browser.icon!
let icon = browser.icon ?? NSWorkspace.shared.icon(forFileType: kUTTypeApplicationBundle as String)
icon.size = NSSize(width: 16.0, height: 16.0)
item.image = browser.icon
menu.addItem(item)