diff --git a/src/libstore/misc.cc b/src/libstore/misc.cc index f184dd857..32786e963 100644 --- a/src/libstore/misc.cc +++ b/src/libstore/misc.cc @@ -239,12 +239,11 @@ StorePaths Store::topoSortPaths(const StorePathSet & paths) { return topoSort(paths, {[&](const StorePath & path) { - StorePathSet references; try { - references = queryPathInfo(path)->references; + return queryPathInfo(path)->references; } catch (InvalidPath &) { + return StorePathSet(); } - return references; }}, {[&](const StorePath & path, const StorePath & parent) { return BuildError(