mirror of
https://github.com/nextcloud/desktop.git
synced 2024-11-23 13:35:58 +03:00
Do not provide items if account is not set up correctly
Signed-off-by: Claudio Cambra <claudio.cambra@nextcloud.com>
This commit is contained in:
parent
7413cf6735
commit
4012d43bb9
1 changed files with 9 additions and 1 deletions
|
@ -104,7 +104,15 @@ import OSLog
|
||||||
request _: NSFileProviderRequest,
|
request _: NSFileProviderRequest,
|
||||||
completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void
|
completionHandler: @escaping (NSFileProviderItem?, Error?) -> Void
|
||||||
) -> Progress {
|
) -> 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)
|
completionHandler(item, nil)
|
||||||
} else {
|
} else {
|
||||||
completionHandler(nil, NSFileProviderError(.noSuchItem))
|
completionHandler(nil, NSFileProviderError(.noSuchItem))
|
||||||
|
|
Loading…
Reference in a new issue