feat: reading preferences on disk will reset file if error (closes #73)
This commit is contained in:
1 parent
d275fc03ff
commit
39677fe542
1 file changed
+4
-1
@@ -68,7 +68,10 @@ class Preferences {
|
|||||||
.forEach { try updateAndValidateFromString($0.key, $0.value) }
|
.forEach { try updateAndValidateFromString($0.key, $0.value) }
|
||||||
} catch {
|
} catch {
|
||||||
debugPrint("Error loading preferences", error)
|
debugPrint("Error loading preferences", error)
|
||||||
NSApp.terminate(NSApplication.shared)
|
if (FileManager.default.fileExists(atPath: userFile.path)) {
|
||||||
|
try! FileManager.default.removeItem(at: userFile)
|
||||||
|
}
|
||||||
|
loadFromDiskAndUpdateValues()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in new issue
Block a user