Vfs plugins: Available plugins must load
authorChristian Kamm <mail@ckamm.de>
Tue, 18 Dec 2018 09:31:17 +0000 (10:31 +0100)
committerKevin Ottens <kevin.ottens@nextcloud.com>
Tue, 15 Dec 2020 09:58:28 +0000 (10:58 +0100)
A plugin that can't be loaded due to dependency issues should not be
considered as available.

src/common/vfs.cpp

index a1ad02efeb216904e17c5728e0c464e4e7405642..4f3b6fadcdf26a37c81b38ee70fdc581ae96756d 100644 (file)
@@ -107,6 +107,13 @@ bool OCC::isVfsPluginAvailable(Vfs::Mode mode)
         return false;
     }
 
+    // Attempting to load the plugin is essential as it could have dependencies that
+    // can't be resolved and thus not be available after all.
+    if (!loader.load()) {
+        qCWarning(lcPlugin) << "Plugin failed to load:" << loader.errorString();
+        return false;
+    }
+
     return true;
 }