|
@@ -233,7 +233,9 @@ class KMFontModel: NSObject {
|
|
|
DispatchQueue.main.async { [weak self] in
|
|
|
guard let self = self else { return }
|
|
|
self.fontComboBox.menu = menu
|
|
|
- self.fontComboBox.selectItem(at: selectedIndex)
|
|
|
+ if selectedIndex >= 0 && selectedIndex < menu.items.count {
|
|
|
+ self.fontComboBox.selectItem(at: selectedIndex)
|
|
|
+ }
|
|
|
|
|
|
let selectedStyleIndex = self.setFontStyle(fontName: self.annotationFontModel!.fontName, currentStyle: self.annotationFontModel!.fontWeight)
|
|
|
self.fontWeightPopUpButton.selectItem(at: Int(selectedStyleIndex))
|