Skip to content

Commit 5d28763

Browse files
committed
Editor state fixes
1 parent 12fb0a5 commit 5d28763

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

FSNotes iOS/BasicViewController.swift

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,10 +112,12 @@ class BasicViewController: UIViewController, SwiftyPageControllerDelegate {
112112
let controller = UserDefaultsManagement.currentController,
113113
controller != 0
114114
{
115-
if let project = Storage.shared().getProjectByNote(url: noteURL) {
115+
if FileManager.default.fileExists(atPath: noteURL.path),
116+
let project = Storage.shared().getProjectByNote(url: noteURL)
117+
{
116118
let note = Note(url: noteURL, with: project)
117119

118-
if let bvc = UIApplication.shared.windows[0].rootViewController as? BasicViewController {
120+
if !note.isEncrypted(), let bvc = UIApplication.shared.windows[0].rootViewController as? BasicViewController {
119121
bvc.containerController.selectController(atIndex: controller, animated: false)
120122

121123
let evc = UIApplication.getEVC()

0 commit comments

Comments
 (0)