From 35ecf5d7b02c4638af5201ff162da36ed3245728 Mon Sep 17 00:00:00 2001 From: Marino Faggiana Date: Mon, 28 Jul 2025 12:03:54 +0200 Subject: [PATCH] test fix Signed-off-by: Marino Faggiana --- Sources/NextcloudKit/NextcloudKitBackground.swift | 4 ++++ 1 file changed, 4 insertions(+) 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) {