about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/libstore/store.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/libstore/store.cc b/src/libstore/store.cc
index 14a3ff6cba46..e676216c9fb4 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);