about summary refs log tree commit diff
path: root/third_party/nix/src/libexpr/primops.cc
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/nix/src/libexpr/primops.cc')
-rw-r--r--third_party/nix/src/libexpr/primops.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/third_party/nix/src/libexpr/primops.cc b/third_party/nix/src/libexpr/primops.cc
index 04a44311a259..dd8a509df32d 100644
--- a/third_party/nix/src/libexpr/primops.cc
+++ b/third_party/nix/src/libexpr/primops.cc
@@ -413,7 +413,7 @@ static void prim_getEnv(EvalState& state, const Pos& pos, Value** args,
   std::string name = state.forceStringNoCtx(*args[0], pos);
   mkString(v, evalSettings.restrictEval || evalSettings.pureEval
                   ? ""
-                  : getEnv(name));
+                  : getEnv(name).value_or(""));
 }
 
 /* Evaluate the first argument, then return the second argument. */