Skip to content

Commit 6e738ed

Browse files
[fix] "[NSURL length]: unrecognized selector sent to instance…"
Trying to remove a file using FileManager.removeItem:at. The URL is an assets-library and something internally is invoking `length` maybe assuming it’s a NSString/CFStringRef 🤨
1 parent 6e47513 commit 6e738ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Sodes/SodesFoundation/FileManager.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ public extension FileManager {
4747

4848
public func removeDirectory(_ directory: URL) -> Bool {
4949
do {
50-
try removeItem(at: directory)
50+
try removeItem(atPath: directory.absoluteString)
5151
}
5252
catch {
5353
return false
@@ -57,7 +57,7 @@ public extension FileManager {
5757

5858
public func removeFile(at url: URL) -> Bool {
5959
do {
60-
try removeItem(at: url)
60+
try removeItem(atPath: url.absoluteString)
6161
}
6262
catch {
6363
return false

0 commit comments

Comments
 (0)