Skip to content

Commit eeb6820

Browse files
committed
2 parents 2c55e27 + a71ec0a commit eeb6820

1 file changed

Lines changed: 8 additions & 1 deletion

File tree

src/util.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -459,7 +459,14 @@ std::vector<std::string> Util::getDLCNamesFromJSON(const Json::Value &root)
459459

460460
std::string Util::getHomeDir()
461461
{
462-
return (std::string)getenv("HOME");
462+
const char* home = getenv("HOME");
463+
464+
if (!home) {
465+
std::cerr << "$HOME is missing, unable to continue.\n";
466+
exit(1);
467+
} else {
468+
return std::string(home);
469+
}
463470
}
464471

465472
std::string Util::getConfigHome()

0 commit comments

Comments
 (0)