diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index f972a65bd..759b33ac6 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -2815,7 +2815,10 @@ static void addPath( auto rewrites = state.realiseContext(context); path = {path.accessor, CanonPath(rewriteStrings(path.path.abs(), rewrites))}; auto [storePath, subPath] = state.store->toStorePath(path.path.abs()); - refs = state.store->queryPathInfo(storePath)->references; + try { + refs = state.store->queryPathInfo(storePath)->references; + } catch (Error &) { // FIXME: should be InvalidPathError + } } std::unique_ptr filter;