diff --git a/Sources/NextcloudKit/NextcloudKitBackground.swift b/Sources/NextcloudKit/NextcloudKitBackground.swift index 50321d35..391566f1 100644 --- a/Sources/NextcloudKit/NextcloudKitBackground.swift +++ b/Sources/NextcloudKit/NextcloudKitBackground.swift @@ -143,6 +143,10 @@ public final class NKBackground: NSObject, URLSessionTaskDelegate, URLSessionDel var uploadSession: URLSession? let groupDefaults = UserDefaults(suiteName: NextcloudKit.shared.nkCommonInstance.groupIdentifier) + guard FileManager.default.fileExists(atPath: fileNameLocalPath) else { + return (nil, .urlError) + } + /// Check if error is in groupDefaults if let array = groupDefaults?.array(forKey: NextcloudKit.shared.nkCommonInstance.groupDefaultsUnauthorized) as? [String], array.contains(account) {