add temporary null handling to variable viewer

This commit is contained in:
Lera Elvoé 2024-02-12 11:08:38 +03:00
parent ca18e36fdc
commit 3378f41b75
No known key found for this signature in database

View file

@ -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 = "<nothing>"
else:
type = DeckType.INVERSE_GODOT_TYPES_MAP[typeof(item_value)]
item.set_meta(&"container", container)
item.set_meta(&"indexed", indexed)