mirror of
https://github.com/keymanapp/keyman.git
synced 2026-10-06 14:07:32 +00:00
Properly defaults 'version' if missing.
This commit is contained in:
parent
ca063d6bf4
commit
32084ab38d
1 changed files with 1 additions and 5 deletions
|
|
@ -697,7 +697,7 @@ public class Manager: NSObject, UIGestureRecognizerDelegate {
|
|||
let data = try Data(contentsOf: path, options: .mappedIfSafe)
|
||||
let jsonResult = try JSONSerialization.jsonObject(with: data, options: .mutableLeaves)
|
||||
if let jsonResult = jsonResult as? [String:AnyObject] {
|
||||
var version: String = "error"
|
||||
var version: String = "1.0"
|
||||
|
||||
if let info = jsonResult["info"] as? [String:AnyObject] {
|
||||
if let versionEntry = info["version"] as? [String:AnyObject] {
|
||||
|
|
@ -707,10 +707,6 @@ public class Manager: NSObject, UIGestureRecognizerDelegate {
|
|||
}
|
||||
}
|
||||
|
||||
if version == "error" {
|
||||
throw KMPError.invalidPackage
|
||||
}
|
||||
|
||||
if let lexicalModels = jsonResult["lexicalModels"] as? [[String:AnyObject]] {
|
||||
for k in lexicalModels {
|
||||
let name = k["name"] as! String
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue