]> git.tdb.fi Git - builder.git/commitdiff
Avoid exception if plugins directory is not found
authorMikko Rasa <tdb@tdb.fi>
Tue, 3 Jan 2023 17:32:29 +0000 (19:32 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 3 Jan 2023 17:32:29 +0000 (19:32 +0200)
source/lib/builder.cpp

index c8c7bf81efbccb47726edef19c1ae11417184103..08e9cd7ef69f68b8d12d2bb61c081d3145db789e 100644 (file)
@@ -5,6 +5,7 @@
 #include <msp/core/maputils.h>
 #include <msp/datafile/parser.h>
 #include <msp/fs/dir.h>
+#include <msp/fs/stat.h>
 #include <msp/fs/utils.h>
 #include <msp/io/buffered.h>
 #include <msp/io/file.h>
@@ -47,6 +48,9 @@ void Builder::load_plugins()
        using CreateFunc = Plugin *(Builder &);
 
        FS::Path plugins_dir = FS::get_sys_lib_dir();
+       if(!FS::exists(plugins_dir))
+               return;
+
        logger->log("files", "Traversing %s", plugins_dir);
        vector<LoadedPlugin> unordered_plugins;
        for(const string &f: list_filtered(plugins_dir, "\\.dlm$"))