Skip to content
Snippets Groups Projects
Commit 3457970b authored by Pregmodder's avatar Pregmodder
Browse files

Merge branch 'shiro-pregmod-master-patch-20970' into 'pregmod-master'

[FCHost][Linux] Prevent crash constructing string from nulltpr

See merge request pregmodfan/fc-pregmod!11101
parents 955f0e76 135c21a6
No related branches found
No related tags found
1 merge request!11101[FCHost][Linux] Prevent crash constructing string from nulltpr
Pipeline #52597 passed
...@@ -70,7 +70,7 @@ namespace { ...@@ -70,7 +70,7 @@ namespace {
switch (mode) { switch (mode) {
case CefDialogHandler::FileDialogMode::FILE_DIALOG_OPEN_MULTIPLE: case CefDialogHandler::FileDialogMode::FILE_DIALOG_OPEN_MULTIPLE:
cmdLine << " --multiple"; [[fallthrough]] cmdLine << " --multiple"; [[fallthrough]];
case CefDialogHandler::FileDialogMode::FILE_DIALOG_OPEN: case CefDialogHandler::FileDialogMode::FILE_DIALOG_OPEN:
cmdLine << " --getopenfilename"; cmdLine << " --getopenfilename";
break; break;
...@@ -171,7 +171,8 @@ namespace { ...@@ -171,7 +171,8 @@ namespace {
// we will try to launch kdialog or zenity // we will try to launch kdialog or zenity
std::string dialogExecutable; std::string dialogExecutable;
// try to determine which environment we run inside // try to determine which environment we run inside
std::string desktop = getenv("XDG_CURRENT_DESKTOP"); const char* desktop_env = getenv("XDG_CURRENT_DESKTOP");
std::string desktop = desktop_env == nullptr ? "" : desktop_env;
const auto checkExeExists = [](const char* name) { const auto checkExeExists = [](const char* name) {
int ec = ::system((std::string(name) + " --help > /dev/null").c_str()); int ec = ::system((std::string(name) + " --help > /dev/null").c_str());
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment