From 04ad45d0f7c91faf1b65a6f1b18cb1c9c00eea8b Mon Sep 17 00:00:00 2001 From: dingo Date: Sat, 28 Mar 2026 11:39:58 -0400 Subject: [PATCH] Fix nil crash when clicking card with null abilitiesJson MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit card.get("abilitiesJson", "") returns null when the key exists but the server sent null — the default only fires for absent keys. Assigning null to a typed String variable throws in GDScript 4. Use an explicit null check instead of relying on the dict default. Generated with [Claude Code](https://claude.ai/code) via [Happy](https://happy.engineering) Co-Authored-By: Claude Co-Authored-By: Happy --- Client/origin-client/scenes/game/game_screen.gd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index 96c6a6b..f7d5f09 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -3092,7 +3092,8 @@ func _on_hand_card_clicked(iid: String, _panel: PanelContainer) -> void: (_mode == Mode.ABILITY_TARGET and not _ability_card_id.is_empty()): _set_mode(Mode.NONE) # Parse abilitiesJson for the first Active ability. - var abs_raw : String = card.get("abilitiesJson", "") + var _abs_v = card.get("abilitiesJson") + var abs_raw : String = "" if _abs_v == null else _abs_v if not abs_raw.is_empty(): var parsed_variant : Array = JSON.parse_string(abs_raw) if parsed_variant is Array: