diff options
Diffstat (limited to 'third_party/nix/src/nix/doctor.cc')
-rw-r--r-- | third_party/nix/src/nix/doctor.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/third_party/nix/src/nix/doctor.cc b/third_party/nix/src/nix/doctor.cc index 0105b05e97fc..e65ca69f6bee 100644 --- a/third_party/nix/src/nix/doctor.cc +++ b/third_party/nix/src/nix/doctor.cc @@ -48,8 +48,8 @@ struct CmdDoctor final : StoreCommand { static bool checkNixInPath() { PathSet dirs; - for (auto& dir : - absl::StrSplit(getEnv("PATH"), absl::ByChar(':'), absl::SkipEmpty())) { + for (auto& dir : absl::StrSplit(getEnv("PATH").value_or(""), + absl::ByChar(':'), absl::SkipEmpty())) { if (pathExists(absl::StrCat(dir, "/nix-env"))) { dirs.insert(dirOf(canonPath(absl::StrCat(dir, "/nix-env"), true))); } @@ -72,8 +72,8 @@ struct CmdDoctor final : StoreCommand { static bool checkProfileRoots(const ref<Store>& store) { PathSet dirs; - for (auto dir : - absl::StrSplit(getEnv("PATH"), absl::ByChar(':'), absl::SkipEmpty())) { + for (auto dir : absl::StrSplit(getEnv("PATH").value_or(""), + absl::ByChar(':'), absl::SkipEmpty())) { Path profileDir = dirOf(dir); try { Path userEnv = canonPath(profileDir, true); |