Merge pull request #116354 from bruvzg/macos_url_null

[macOS] Add null check to `get_framework_executable`.
This commit is contained in:
Thaddeus Crews 2026-02-16 10:19:36 -06:00
commit 43c9a32b3d
No known key found for this signature in database
GPG key ID: 8C6E5FEB5FC03CCC

View file

@ -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;
}
}
}