don't open deck tab if the deck is null (#160)

closes #98, but crucially doesn't add any real error checking in the actual deck loading code, instead just opting to refuse to open a tab for a deck that comes out null from DeckHolder.

Reviewed-on: https://codeberg.org/StreamGraph/StreamGraph/pulls/160
Co-authored-by: Lera Elvoé <yagich@poto.cafe>
Co-committed-by: Lera Elvoé <yagich@poto.cafe>
This commit is contained in:
Lera Elvoé 2024-05-20 06:11:15 +00:00 committed by yagich
parent 3a7facf948
commit 33425e8436

View file

@ -393,6 +393,9 @@ func open_deck_at_path(path: String) -> void:
func open_deck_from_dict(data: Dictionary, path: String) -> void:
var deck := DeckHolder.open_deck_from_dict(data, path)
if deck == null:
DeckHolder.logger.toast_error("Error loading deck at path: %s" % path)
return
var inst: DeckRendererGraphEdit = DECK_SCENE.instantiate()
inst.deck = deck
var tab := tab_container.add_content(inst, path.get_file())