Deal more gracefully with absent choices
This commit is contained in:
parent
b7628c8c65
commit
ccba71cc2e
|
@ -111,7 +111,7 @@ class ASHardware {
|
||||||
if choices.count <= 10 {
|
if choices.count <= 10 {
|
||||||
menu.addSortedChoices([ASPropertyEntry](choices.values), target: target, selector: selector)
|
menu.addSortedChoices([ASPropertyEntry](choices.values), target: target, selector: selector)
|
||||||
} else {
|
} 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())
|
menu.addItem(NSMenuItem.separatorItem())
|
||||||
var seen = [String: Bool]()
|
var seen = [String: Bool]()
|
||||||
for prop in choices.values {
|
for prop in choices.values {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user