Skip to content

Commit 5ddd7e3

Browse files
author
Thomas Taschauer
committed
fix crash
1 parent a9b9f1c commit 5ddd7e3

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

OpenDocumentReader/AppDelegate.swift

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,9 +78,13 @@ class AppDelegate: UIResponder, UIApplicationDelegate {
7878
}
7979

8080
documentBrowserViewController.revealDocument(at: destinationUrl, importIfNeeded: true) { (revealedDocumentURL, error) in
81-
// ignoring errors because they should pop up in failedToImportDocumentAt too
82-
83-
documentBrowserViewController.presentDocument(at: revealedDocumentURL!)
81+
guard let documentUrl = revealedDocumentURL else {
82+
// ignoring errors because they should pop up in failedToImportDocumentAt too
83+
84+
return;
85+
}
86+
87+
documentBrowserViewController.presentDocument(at: documentUrl)
8488
}
8589

8690
return true

0 commit comments

Comments
 (0)