diff --git a/src/gui/macOS/fileproviderxpc.h b/src/gui/macOS/fileproviderxpc.h index 349dfc3264034..be68468b16a92 100644 --- a/src/gui/macOS/fileproviderxpc.h +++ b/src/gui/macOS/fileproviderxpc.h @@ -45,7 +45,7 @@ public slots: void configureExtensions(); void authenticateExtension(const QString &extensionAccountId) const; void unauthenticateExtension(const QString &extensionAccountId) const; - void createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename) const; + void createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename); void setFastEnumerationEnabledForExtension(const QString &extensionAccountId, bool enabled) const; diff --git a/src/gui/macOS/fileproviderxpc_mac.mm b/src/gui/macOS/fileproviderxpc_mac.mm index 4c55cc5d34490..13896e3963cac 100644 --- a/src/gui/macOS/fileproviderxpc_mac.mm +++ b/src/gui/macOS/fileproviderxpc_mac.mm @@ -109,9 +109,13 @@ break; } } -void FileProviderXPC::createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename) const +void FileProviderXPC::createDebugArchiveForExtension(const QString &extensionAccountId, const QString &filename) { qCInfo(lcFileProviderXPC) << "Creating debug archive for extension" << extensionAccountId << "at" << filename; + if (!fileProviderExtReachable(extensionAccountId)) { + qCWarning(lcFileProviderXPC) << "Extension is not reachable. Cannot create debug archive"; + return; + } // You need to fetch the contents from the extension and then create the archive from the client side. // The extension is not allowed to ask for permission to write into the file system as it is not a user facing process. const auto clientCommService = (NSObject *)_clientCommServices.value(extensionAccountId);