From: Mikko Rasa Date: Tue, 3 Jan 2023 11:48:03 +0000 (+0200) Subject: Avoid exception if a directory in the package path does not exist X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=19de47d18af9c3021d77a7f84622a352adbd6ae5;p=builder.git Avoid exception if a directory in the package path does not exist --- diff --git a/source/lib/packagemanager.cpp b/source/lib/packagemanager.cpp index 37374b6..5e12422 100644 --- a/source/lib/packagemanager.cpp +++ b/source/lib/packagemanager.cpp @@ -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 files = list_filtered(p, "\\.bpk$"); for(const string &f: files)