From 3378f41b7535d05c7cc9d3496143abf33ec466c7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Mon, 12 Feb 2024 11:08:38 +0300 Subject: [PATCH] add temporary null handling to variable viewer --- graph_node_renderer/variable_viewer.gd | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/graph_node_renderer/variable_viewer.gd b/graph_node_renderer/variable_viewer.gd index 2cf5148..4aa44a4 100644 --- a/graph_node_renderer/variable_viewer.gd +++ b/graph_node_renderer/variable_viewer.gd @@ -130,7 +130,14 @@ func add_item(item_name: String, item_value: Variant, parent: TreeItem = root, c var item := variable_tree.create_item(parent) item.set_text(0, item_name) - var type: DeckType.Types = DeckType.INVERSE_GODOT_TYPES_MAP[typeof(item_value)] + # TODO: proper null handling + var value_type := typeof(item_value) + var type: DeckType.Types + if value_type == TYPE_NIL: + type = DeckType.Types.STRING + item_value = "" + else: + type = DeckType.INVERSE_GODOT_TYPES_MAP[typeof(item_value)] item.set_meta(&"container", container) item.set_meta(&"indexed", indexed)