diff --git a/src/libstore/gc.cc b/src/libstore/gc.cc index d646dd3dec..01d85d4d52 100644 --- a/src/libstore/gc.cc +++ b/src/libstore/gc.cc @@ -332,7 +332,7 @@ static void addAdditionalRoots(PathSet & roots) for (Strings::iterator i = paths.begin(); i != paths.end(); ++i) { if (isInStore(*i)) { Path path = toStorePath(*i); - if (roots.find(path) == roots.end()) { + if (roots.find(path) == roots.end() && isValidPath(path)) { debug(format("found additional root `%1%'") % path); roots.insert(path); }