diff --git a/src/nix/command.cc b/src/nix/command.cc
index f90d848f2a40916747a5b8ea31b45300847f29fd..058a7548c893b1403ed054cee9d23bcb6f65d199 100644
--- a/src/nix/command.cc
+++ b/src/nix/command.cc
@@ -97,7 +97,7 @@ ref<Store> StoreCommand::createStore()
 
 void StoreCommand::run()
 {
-    run(createStore());
+    run(getStore());
 }
 
 StorePathsCommand::StorePathsCommand()