about summary refs log tree commit diff
path: root/src/nix-store/nix-store.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/nix-store/nix-store.cc')
-rw-r--r--src/nix-store/nix-store.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/nix-store/nix-store.cc b/src/nix-store/nix-store.cc
index 902a2296786f..ca49e231c0d5 100644
--- a/src/nix-store/nix-store.cc
+++ b/src/nix-store/nix-store.cc
@@ -83,6 +83,7 @@ static PathSet realisePath(const Path & path, bool build = true)
 
     else {
         if (build) store->ensurePath(path);
+        else if (!store->isValidPath(path)) throw Error(format("path `%1%' does not exist and cannot be created") % path);
         return singleton<PathSet>(path);
     }
 }