Salome HOME
[EDF30062] : Steering proxy threshold/directory without environement considerations...
[modules/kernel.git] / src / Basics / Basics_Utils.cxx
index 1725a319c6ec28a3607c3ccb799d034e77acc087..2f0338f97274c59e673621d32a6b70a1beb1bbc8 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2007-2022  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2024  CEA, EDF, OPEN CASCADE
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
@@ -175,7 +175,7 @@ namespace Kernel_Utils
   {
     std::stringstream sstr;
     sstr<<name<<'='<<value;
-    if(rewrite || std::string(getenv(name)).length() == 0)
+    if(rewrite || getenv(name) == nullptr || std::string(getenv(name)).length() == 0)
       return _putenv(sstr.str().c_str());
     else return -1;
   }