|
@@ -23,13 +23,14 @@ class KMBookmarkManager {
|
|
|
}
|
|
|
|
|
|
func reloadData() {
|
|
|
- let bookmarkDictionary: NSDictionary = UserDefaults.standard.persistentDomain(forName: bookmarksIdentifier)! as NSDictionary
|
|
|
- let documents: NSArray = bookmarkDictionary.object(forKey: kRecentDocuments) as! NSArray
|
|
|
+ let bookmarkDictionary: NSDictionary = (UserDefaults.standard.persistentDomain(forName: bookmarksIdentifier) ?? NSDictionary() as! [String : Any]) as NSDictionary
|
|
|
+ let documents: NSArray = (bookmarkDictionary.object(forKey: kRecentDocuments) ?? NSArray()) as! NSArray
|
|
|
for info in documents {
|
|
|
recentDocuments.append(info as! [String : Any])
|
|
|
}
|
|
|
|
|
|
- rootBookmark = KMRootBookmark.bookmarkRoot(childrenProperties: bookmarkDictionary[kBookmarks] as! NSArray)
|
|
|
+ let childrenProperties = (bookmarkDictionary[kBookmarks] ?? NSArray()) as! NSArray
|
|
|
+ rootBookmark = KMRootBookmark.bookmarkRoot(childrenProperties: childrenProperties)
|
|
|
}
|
|
|
|
|
|
func saveData() {
|