Platform (Windows): adds a null check

This commit is contained in:
李通洲
2025-12-03 14:41:19 +08:00
parent 98fb810f1f
commit 100cd9a72b
+6 -2
View File
@@ -164,8 +164,12 @@ static void getHostName(FFPlatform* platform)
static void getUserShell(FFPlatform* platform)
{
// Works in MSYS2
ffStrbufAppendS(&platform->userShell, getenv("SHELL"));
ffStrbufReplaceAllC(&platform->userShell, '\\', '/');
const char* userShell = getenv("SHELL");
if (userShell)
{
ffStrbufAppendS(&platform->userShell, userShell);
ffStrbufReplaceAllC(&platform->userShell, '\\', '/');
}
}
static const char* detectWine(void)