From ccba71cc2e4793d9d7c878978c2298cfbd7e3a1f Mon Sep 17 00:00:00 2001 From: Matthias Neeracher Date: Thu, 24 Dec 2015 03:05:15 +0100 Subject: [PATCH] Deal more gracefully with absent choices --- AVRsack/ASHardware.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/AVRsack/ASHardware.swift b/AVRsack/ASHardware.swift index 1789eae..22ebf13 100644 --- a/AVRsack/ASHardware.swift +++ b/AVRsack/ASHardware.swift @@ -111,7 +111,7 @@ class ASHardware { if choices.count <= 10 { menu.addSortedChoices([ASPropertyEntry](choices.values), target: target, selector: selector) } else { - menu.addSortedChoices(recentChoices.map({ (recent: String) in choices[recent]! }), target: target, selector: selector) + menu.addSortedChoices(recentChoices.flatMap({ (recent: String) in choices[recent] }), target: target, selector: selector) menu.addItem(NSMenuItem.separatorItem()) var seen = [String: Bool]() for prop in choices.values {