From 19de47d18af9c3021d77a7f84622a352adbd6ae5 Mon Sep 17 00:00:00 2001 From: Mikko Rasa Date: Tue, 3 Jan 2023 13:48:03 +0200 Subject: [PATCH] Avoid exception if a directory in the package path does not exist --- source/lib/packagemanager.cpp | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- 2.45.2