aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/libexpr/eval.cc12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/libexpr/eval.cc b/src/libexpr/eval.cc
index 6ac8bbc9f..a5ebd1bf0 100644
--- a/src/libexpr/eval.cc
+++ b/src/libexpr/eval.cc
@@ -381,10 +381,14 @@ EvalState::EvalState(const Strings & _searchPath, ref<Store> store)
auto path = r.second;
if (store->isInStore(r.second)) {
- StorePathSet closure;
- store->computeFSClosure(store->toStorePath(r.second).first, closure);
- for (auto & path : closure)
- allowedPaths->insert(store->printStorePath(path));
+ try {
+ StorePathSet closure;
+ store->computeFSClosure(store->toStorePath(r.second).first, closure);
+ for (auto & path : closure)
+ allowedPaths->insert(store->printStorePath(path));
+ } catch (InvalidPath &) {
+ allowedPaths->insert(r.second);
+ }
} else
allowedPaths->insert(r.second);
}