about summary refs log tree commit diff
path: root/third_party/nix/src/nix/doctor.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/nix/doctor.cc')
-rw-r--r--third_party/nix/src/nix/doctor.cc8
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 0105b05e97..e65ca69f6b 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);