Skip to content

Commit c39a179

Browse files
Merge pull request #175 from nextcloud/upload-enh
test fix
2 parents b82605a + 35ecf5d commit c39a179

1 file changed

Lines changed: 4 additions & 0 deletions

File tree

Sources/NextcloudKit/NextcloudKitBackground.swift

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ public final class NKBackground: NSObject, URLSessionTaskDelegate, URLSessionDel
143143
var uploadSession: URLSession?
144144
let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier)
145145

146+
guard FileManager.default.fileExists(atPath: fileNameLocalPath) else {
147+
return (nil, .urlError)
148+
}
149+
146150
/// Check if error is in groupDefaults
147151
if let array = groupDefaults?.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) as? [String],
148152
array.contains(account) {

0 commit comments

Comments
 (0)