From 100cd9a72beefb01460cf462699df18b193f2d1e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E9=80=9A=E6=B4=B2?= Date: Wed, 3 Dec 2025 14:41:19 +0800 Subject: [PATCH] Platform (Windows): adds a null check --- src/util/platform/FFPlatform_windows.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/util/platform/FFPlatform_windows.c b/src/util/platform/FFPlatform_windows.c index 07f30e2c7..a916de4fe 100644 --- a/src/util/platform/FFPlatform_windows.c +++ b/src/util/platform/FFPlatform_windows.c @@ -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)