diff --git a/src/libstore/path.cc b/src/libstore/path.cc index d989b1caa..595cf77e1 100644 --- a/src/libstore/path.cc +++ b/src/libstore/path.cc @@ -77,6 +77,9 @@ StorePath StorePath::random(std::string_view name) StorePath MixStoreDirMethods::parseStorePath(std::string_view path) const { + if (path.empty()) + throw BadStorePath("empty path is not a valid store path"); + // On Windows, `/nix/store` is not a canonical path. More broadly it // is unclear whether this function should be using the native // notion of a canonical path at all. For example, it makes to