From bc5805e8e6c8e94cf299654a802cc68e4986c84c Mon Sep 17 00:00:00 2001 From: Eric Warmenhoven Date: Fri, 9 Feb 2024 10:31:59 -0500 Subject: [PATCH] Fix #16205, crash on non-Metal build (#16214) --- file_path_special.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/file_path_special.c b/file_path_special.c index 05b3bbda62..ed64e62f14 100644 --- a/file_path_special.c +++ b/file_path_special.c @@ -110,11 +110,16 @@ bool fill_pathname_application_data(char *s, size_t len) portable = true; #else CFStringRef key = CFStringCreateWithCString(NULL, "RAPortableInstall", kCFStringEncodingUTF8); - CFBooleanRef val = CFBundleGetValueForInfoDictionaryKey(bundle, key); - if (val) - portable = CFBooleanGetValue(val); - CFRelease(val); - CFRelease(key); + if (key) + { + CFBooleanRef val = CFBundleGetValueForInfoDictionaryKey(bundle, key); + if (val) + { + portable = CFBooleanGetValue(val); + CFRelease(val); + } + CFRelease(key); + } #endif if (portable) {