diff --git a/Source/Common/Config.cpp b/Source/Common/Config.cpp index 622f9942ab..adb2bc1566 100644 --- a/Source/Common/Config.cpp +++ b/Source/Common/Config.cpp @@ -439,17 +439,17 @@ const char* GetHomeDirectory() { const char* HomeDir = getenv("HOME"); // Try to get home directory from uid - if (!HomeDir) { + if (!HomeDir || !FHU::Filesystem::Exists(HomeDir)) { HomeDir = FindUserHomeThroughUID(); } // try the PWD - if (!HomeDir) { + if (!HomeDir || !FHU::Filesystem::Exists(HomeDir)) { HomeDir = getenv("PWD"); } // Still doesn't exit? You get local - if (!HomeDir) { + if (!HomeDir || !FHU::Filesystem::Exists(HomeDir)) { HomeDir = "."; }