From: Claudio Cambra Date: Thu, 1 Aug 2024 08:21:01 +0000 (+0800) Subject: Do not provide items if account is not set up correctly X-Git-Tag: archive/raspbian/3.16.7-1_deb13u1+rpi1~1^2~12^2~6^2~22^2~1 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=bda7d45a6b164466e6e187a15528efbc115dda87;p=nextcloud-desktop.git Do not provide items if account is not set up correctly Signed-off-by: Claudio Cambra --- diff --git a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift index fd3670a38..db5eda2d5 100644 --- a/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift +++ b/shell_integration/MacOSX/NextcloudIntegration/FileProviderExt/FileProviderExtension.swift @@ -104,7 +104,15 @@ import OSLog request _: NSFileProviderRequest, completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void ) -> Progress { - if let item = Item.storedItem(identifier: identifier, remoteInterface: ncKit) { + if ncAccount == nil { + Logger.fileProviderExtension.error( + """ + Not fetching item for identifier: \(identifier.rawValue, privacy: .public) + as account not set up yet. + """ + ) + completionHandler(nil, NSFileProviderError(.notAuthenticated)) + } else if let item = Item.storedItem(identifier: identifier, remoteInterface: ncKit) { completionHandler(item, nil) } else { completionHandler(nil, NSFileProviderError(.noSuchItem))