Repository: godot
Issue: Crash on Android ternary expression (no crash on debug build)
Labels: bug,platform:android,topic:gdscript,crash

### Godot version

3.5.stable

### System information

Pixel 3a XL Android 9

### Issue description

My app has a Singleton that pulls objects from its own dictionary.

game_configuration.gd
```
var _user_settings = {
	"username": "",
	"local_profile": null,
}

func get_user_setting(name: String):
	print_debug("get ", name)
	if _user_settings.has(name):
		print_debug("has gotten")
		return _user_settings[name]
	else:
		print_debug("is null")
		return null
```

I create a node that has this script attached to it:
```
var local_profile = GameConfiguration.get_user_setting("local_profile")
var profile = {
	"username": GameConfiguration.get_user_setting("username"),
	"preferred_ball": local_profile.fields.preferred_ball if local_profile.has("fields") and local_profile.fields.has("preferred_ball") else "default",
}
```

It crashes. If I remove the "preferred_ball" line from the profile dictionary object, it no longer crashes. This only crashes on a "release" Android build.

```
    --------- beginning of system
2022-08-17 00:01:32.289 1736-1736/? I/PowerUI: currentTemp=27.614002,overheatType=1,isOverheatAlarm=false,thresholdTemp=63.0,batteryStatus=2,recentTemps=27.614002,27.614002,27.614002,27.614002,
2022-08-17 00:01:32.295 1736-1736/? I/PowerUI: currentTemp=27.614002,overheatType=1,isOverheatAlarm=false,thresholdTemp=63.0,batteryStatus=2,recentTemps=27.614002,27.614002,27.614002,27.614002,27.614002,
2022-08-17 00:01:33.053 26511-26529/? I/godot: Connected to lobby server 1
2022-08-17 00:01:33.053 26511-26529/? I/godot: Initialized WebRTC client
2022-08-17 00:01:33.064 26511-26529/? I/godot: get local_profile
2022-08-17 00:01:33.064 26511-26529/? I/godot: has gotten
2022-08-17 00:01:33.064 26511-26529/? I/godot: get username
2022-08-17 00:01:33.064 26511-26529/? I/godot: has gotten
    
    
    --------- beginning of crash
2022-08-17 00:01:33.065 26511-26529/? A/libc: Fatal signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10 in tid 26529 (GLThread 5988), pid 26511 (otengine.srtest)
2022-08-17 00:01:33.147 26585-26585/? I/crash_dump64: obtaining output fd from tombstoned, type: kDebuggerdTombstone
2022-08-17 00:01:33.149 951-951/? I//system/bin/tombstoned: received crash request for pid 26529
2022-08-17 00:01:33.150 26585-26585/? I/crash_dump64: performing dump of process 26511 (target tid = 26529)
2022-08-17 00:01:33.158 26585-26585/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG: Build fingerprint: 'google/bonito/bonito:9/PQ3B.190801.002/5674421:user/release-keys'
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG: Revision: 'MP1.0'
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG: ABI: 'arm64'
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG: pid: 26511, tid: 26529, name: GLThread 5988  >>> org.godotengine.srtest <<<
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG: Cause: null pointer dereference
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x0  0000006f83859ca0  x1  0000006f84233168  x2  0000006f8894dbf8  x3  0000000000000001
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x4  0000006f8894dbc8  x5  0000006f8894dd38  x6  1c1e000000000000  x7  0000000000801e1c
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x8  0000006f9e4626c0  x9  0000000000000000  x10 0000000000000018  x11 0000000000000000
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x12 0000000000000008  x13 0000000000000008  x14 0000000000000065  x15 1c1e000000000000
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x16 0000006f83859d90  x17 000000702a844100  x18 0000006f8894c75a  x19 0000006f8894dbc8
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x20 0000006f8894dd38  x21 0000000000000001  x22 0000006f83859ca0  x23 0000006f88951588
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x24 0000006f88c9d482  x25 0000000000000001  x26 0000006f8a5a1718  x27 0000006f88bf998c
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     x28 0000006f8894dbb0  x29 0000006f8894deb0
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     sp  0000006f8894daf0  lr  0000006f891ecc60  pc  0000006f8a2737fc
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG: backtrace:
2022-08-17 00:01:33.159 26585-26585/? A/DEBUG:     #00 pc 000000000181a7fc  /data/app/org.godotengine.srtest-UzeTNUsMkjdeDxhKZLOTVA==/lib/arm64/libgodot_android.so (offset 0x5a5000)
2022-08-17 00:01:33.160 26585-26585/? A/DEBUG:     #01 pc 0000000001b47714  /data/app/org.godotengine.srtest-UzeTNUsMkjdeDxhKZLOTVA==/lib/arm64/libgodot_android.so (offset 0x1b39000)
2022-08-17 00:01:33.393 951-951/? E//system/bin/tombstoned: Tombstone written to: /data/tombstones/tombstone_06
2022-08-17 00:01:33.400 1334-26588/? W/ActivityManager:   Force finishing activity org.godotengine.srtest/com.godot.game.GodotApp
2022-08-17 00:01:33.404 1334-1359/? I/BootReceiver: Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
2022-08-17 00:01:33.415 1334-1353/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
2022-08-17 00:01:33.415 1334-1353/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
2022-08-17 00:01:33.423 1334-1353/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.stats.service.DropBoxEntryAddedReceiver
2022-08-17 00:01:33.424 1334-1353/? W/BroadcastQueue: Background execution not allowed: receiving Intent { act=android.intent.action.DROPBOX_ENTRY_ADDED flg=0x10 (has extras) } to com.google.android.gms/.chimera.GmsIntentOperationService$PersistentTrustedReceiver
2022-08-17 00:01:33.493 2786-2786/? I/ContentFeedManager: initSyncRunnable called
2022-08-17 00:01:33.493 2786-2786/? I/WearableDeviceFactory: getConnectedDeviceIdByType()::deviceType = Gear, size = 0
2022-08-17 00:01:33.493 2786-2786/? I/ContentFeedManager: getmDeviceId: device id: null
2022-08-17 00:01:33.493 2786-2786/? I/WearableDeviceFactory: getConnectedDeviceIdByType()::deviceType = Gear, size = 0
2022-08-17 00:01:33.493 2786-2786/? I/ContentFeedManager: getmDeviceId: device id: null
2022-08-17 00:01:33.493 2786-2786/? I/ContentFeedManager: initSyncManagersAndSyncIfRequired: deviceid null
2022-08-17 00:01:33.493 2786-2786/? I/ContentFeedManager: initSyncRunnable initialized
```

This `Cause: null pointer dereference` is most likely due to "local_profile" being null. But why does this cause a crash on the release build and not the debug build?

### Steps to reproduce

1. Create Godot project
2. Write code to initialize a WebRTCMultiplayer object
3. Project -> Install android built template
4. Export as Android app, check "Use Custom Build", Make sure "Export With Debug" IS NOT CHECKED. Permissions: Access Network State, Internet.

### Minimal reproduction project

_No response_