From 07851f82719d65a34b425e0a204d23d0159aa36e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pa=CC=84vels=20Nadtoc=CC=8Cajevs?= <7645683+bruvzg@users.noreply.github.com> Date: Mon, 16 Feb 2026 16:16:53 +0200 Subject: [PATCH] [macOS] Add null check to `get_framework_executable`. --- platform/macos/os_macos.mm | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/platform/macos/os_macos.mm b/platform/macos/os_macos.mm index 625d59a2bf..9b53f9f3b4 100644 --- a/platform/macos/os_macos.mm +++ b/platform/macos/os_macos.mm @@ -369,11 +369,13 @@ _FORCE_INLINE_ String OS_MacOS::get_framework_executable(const String &p_path) { // Read framework bundle to get executable name. NSURL *url = [NSURL fileURLWithPath:@(p_path.utf8().get_data())]; - NSBundle *bundle = [NSBundle bundleWithURL:url]; - if (bundle) { - String exe_path = String::utf8([[bundle executablePath] UTF8String]); - if (da->file_exists(exe_path)) { - return exe_path; + if (url) { + NSBundle *bundle = [NSBundle bundleWithURL:url]; + if (bundle) { + String exe_path = String::utf8([[bundle executablePath] UTF8String]); + if (da->file_exists(exe_path)) { + return exe_path; + } } }