Closed Arjan-Zuidema closed 1 year ago
Could you test if the following fixes your issue?
diff --git a/ios/FileAccess.swift b/ios/FileAccess.swift
index a518891..e6ec35c 100644
--- a/ios/FileAccess.swift
+++ b/ios/FileAccess.swift
@@ -285,7 +285,7 @@ public class FileAccess : NSObject {
let base = URL(fileURLWithPath: path.path())
do {
try resolve(FileManager.default.contentsOfDirectory(atPath: path.path())
- .map { try self.statFile(path: base.appendingPathComponent($0).path) }
+ .compactMap { try? self.statFile(path: base.appendingPathComponent($0).path) }
)
} catch {
reject("ERR", "Failed to list '\(path)'.", error)
Your patch also works fine and seems a bit cleaner :)
Hi! 👋
Firstly, thanks for your work on this project! 🙂
Today I used patch-package to patch
react-native-file-access@3.0.3
for the project I'm working on.Sometimes when requesting the
statDir
function (with many files) some of the resulting files fromcontentsOfDirectory
would not exists (anymore) which results in an error when trying to callstatFile
.This patch fixes that issue. I don't know if this patch is the right way to handle the errors. Please let me know so I can create a pull request if needed.
Here is the diff that solved my problem:
This issue body was partially generated by patch-package.