From 5b4b7893f8dcb13465f5f91dd6c3685cc9986c46 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Mon, 5 Nov 2018 13:11:43 +0200 Subject: [PATCH] Fixed: openURL crash under linux --HG-- branch : develop --- code/nel/src/misc/common.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/nel/src/misc/common.cpp b/code/nel/src/misc/common.cpp index 599f3cfb2..48e6e9845 100644 --- a/code/nel/src/misc/common.cpp +++ b/code/nel/src/misc/common.cpp @@ -1720,12 +1720,12 @@ static bool openDocWithExtension (const std::string &document, const std::string const char *previousEnv = getenv("LD_LIBRARY_PATH"); // clear LD_LIBRARY_PATH to avoid problems with Steam Runtime - setenv("LD_LIBRARY_PATH", "", 1); + if (previousEnv) setenv("LD_LIBRARY_PATH", "", 1); bool res = launchProgram(command, document); // restore previous LD_LIBRARY_PATH - setenv("LD_LIBRARY_PATH", previousEnv, 1); + if (previousEnv) setenv("LD_LIBRARY_PATH", previousEnv, 1); return res; #endif // NL_OS_WINDOWS