Skip to content

Crashes at loadBookmarks if bookmarks are never saved before #1

@hinzberg

Description

@hinzberg

If the bookmarks are never saved before you should not force unwrap them.
I fixed it like this.

func loadBookmarks()
{
let path = getBookmarkPath()

let bookmarksTemp = NSKeyedUnarchiver.unarchiveObject(withFile: path) as? [URL: Data]
if bookmarksTemp != nil {
    bookmarks = bookmarksTemp!
    for bookmark in bookmarks
    {
        restoreBookmark(bookmark)
    }
}

}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions