]> git.tdb.fi Git - builder.git/commitdiff
Avoid exception if a directory in the package path does not exist
authorMikko Rasa <tdb@tdb.fi>
Tue, 3 Jan 2023 11:48:03 +0000 (13:48 +0200)
committerMikko Rasa <tdb@tdb.fi>
Tue, 3 Jan 2023 11:48:03 +0000 (13:48 +0200)
source/lib/packagemanager.cpp

index 37374b6ef05ea6e8c18ad5c7c92f868db8dee0bb..5e124220d7be2a65693e6bb777fac71cfa3d739a 100644 (file)
@@ -182,6 +182,9 @@ FS::Path PackageManager::get_package_location(const string &name)
        {
                for(const FS::Path &p: pkg_path)
                {
+                       if(!FS::exists(p))
+                               continue;
+
                        builder.get_logger().log("files", "Traversing %s", p);
                        unsigned count = 0;
                        for(const string &f: list_files(p))
@@ -223,6 +226,9 @@ FS::Path PackageManager::get_binary_package_file(const string &name)
        {
                for(const FS::Path &p: binpkg_path)
                {
+                       if(!FS::exists(p))
+                               continue;
+
                        builder.get_logger().log("files", "Traversing %s", p);
                        vector<string> files = list_filtered(p, "\\.bpk$");
                        for(const string &f: files)