1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-13 14:02:42 +01:00

Don’t fail when the store contains some invalid paths

This commit is contained in:
Théophane Hufschmitt 2022-04-11 10:20:36 +02:00
parent f3b9d3fd88
commit 8f622ff71b

View file

@ -341,9 +341,12 @@ Roots LocalStore::findRoots(bool censor)
throw Error("Invalid result from the gc helper"); throw Error("Invalid result from the gc helper");
auto rawDestPath = parsedLine[0]; auto rawDestPath = parsedLine[0];
if (!isInStore(rawDestPath)) continue; if (!isInStore(rawDestPath)) continue;
try {
auto destPath = toStorePath(rawDestPath).first; auto destPath = toStorePath(rawDestPath).first;
if (!isValidPath(destPath)) continue; if (!isValidPath(destPath)) continue;
roots[destPath].insert(parsedLine[1]); roots[destPath].insert(parsedLine[1]);
} catch (Error &) {
}
} }
} catch (EndOfFile &) { } catch (EndOfFile &) {
} }