diff --git a/src/libstore/store.cc b/src/libstore/store.cc index 14a3ff6cba..e676216c9f 100644 --- a/src/libstore/store.cc +++ b/src/libstore/store.cc @@ -546,7 +546,8 @@ void deleteFromStore(const Path & _path) assertStorePath(path); Transaction txn(nixDB); - invalidatePath(path, txn); + if (isValidPathTxn(txn, path)) + invalidatePath(path, txn); txn.commit(); deletePath(path);