Skip to content

Commit

Permalink
only validate documents url when it non-nils
Browse files Browse the repository at this point in the history
or the app fails to launch if iCloud is disabled (such as on simulator)
  • Loading branch information
llcc authored and andelf committed Jul 7, 2022
1 parent 4356431 commit 8fad38d
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions ios/App/App/FileContainer.swift
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,13 @@ public class FileContainer: CAPPlugin, UIDocumentPickerDelegate {

@objc func ensureDocuments(_ call: CAPPluginCall) {

validateDocuments(at: self.iCloudContainerUrl!)
validateDocuments(at: self.localContainerUrl!)
if self.iCloudContainerUrl != nil {
validateDocuments(at: self.iCloudContainerUrl!)
}

if self.localContainerUrl != nil {
validateDocuments(at: self.localContainerUrl!)
}

call.resolve(["path": [self.iCloudContainerUrl?.path as Any,
self.localContainerUrl?.path as Any]])
Expand Down

0 comments on commit 8fad38d

Please sign in to comment.