mirror of
https://github.com/keymanapp/keyman.git
synced 2026-08-08 01:45:32 +00:00
Fix unwrapping nil
This commit is contained in:
parent
a49c6a269e
commit
136e08b2f1
1 changed files with 6 additions and 4 deletions
|
|
@ -1167,18 +1167,20 @@ class MainViewController: UIViewController, KMTextViewDelegate, UIActionSheetDel
|
|||
return true
|
||||
}
|
||||
|
||||
let userKbs: [[String: Any]]! = userData.object(forKey: kKeymanUserKeyboardsListKey) as? [[String: Any]]
|
||||
if userKbs.count >= 2 {
|
||||
return false
|
||||
guard let userKbs = userData.object(forKey: kKeymanUserKeyboardsListKey) as? [[String: Any]] else {
|
||||
return true
|
||||
}
|
||||
if userKbs.isEmpty {
|
||||
return true
|
||||
}
|
||||
if userKbs.count >= 2 {
|
||||
return false
|
||||
}
|
||||
|
||||
let firstKB = userKbs[0]
|
||||
let kbID = firstKB[kKeymanKeyboardIdKey] as? String
|
||||
let langID = firstKB[kKeymanLanguageIdKey] as? String
|
||||
if (kbID == kKeymanDefaultKeyboardID) && (langID == langID) {
|
||||
if (kbID == kKeymanDefaultKeyboardID) && (langID == kKeymanDefaultLanguageID) {
|
||||
return true
|
||||
}
|
||||
return false
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue