From 33425e843686c6a23a189cef0adcc9621d4ddfc3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Lera=20Elvo=C3=A9?= Date: Mon, 20 May 2024 06:11:15 +0000 Subject: [PATCH] don't open deck tab if the deck is null (#160) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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Ʃ Co-committed-by: Lera ElvoƩ --- graph_node_renderer/deck_holder_renderer.gd | 3 +++ 1 file changed, 3 insertions(+) diff --git a/graph_node_renderer/deck_holder_renderer.gd b/graph_node_renderer/deck_holder_renderer.gd index c88c338..15fff0a 100644 --- a/graph_node_renderer/deck_holder_renderer.gd +++ b/graph_node_renderer/deck_holder_renderer.gd @@ -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())