mirror of https://github.com/vitalif/openscad
bugfix: Don't crash if HOME is not set
parent
556040439e
commit
34a758c7f6
|
@ -3,8 +3,13 @@
|
|||
|
||||
std::string PlatformUtils::documentsPath()
|
||||
{
|
||||
fs::path docpath(getenv("HOME"));
|
||||
docpath = docpath / ".local" / "share";
|
||||
|
||||
return boosty::stringy(docpath);
|
||||
const char *home = getenv("HOME");
|
||||
if (home) {
|
||||
fs::path docpath(home);
|
||||
docpath = docpath / ".local" / "share";
|
||||
return boosty::stringy(docpath);
|
||||
}
|
||||
else {
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue