Platform (Windows): adds a null check

This commit is contained in:
李通洲 committed 2025-12-08 09:49:54 +08:00
1 parent 98fb810f1f
commit 100cd9a72b
1 file changed
+6 -2
+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)