From 852bda047c8341fc6b3016405a981e324a83b6e0 Mon Sep 17 00:00:00 2001 From: Fabien Freling Date: Wed, 3 Jun 2020 16:16:14 +0200 Subject: [PATCH] check node validity before loading --- src/Main.gd | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Main.gd b/src/Main.gd index c3f0a09..216df57 100644 --- a/src/Main.gd +++ b/src/Main.gd @@ -59,7 +59,10 @@ func load_game(): # Call the node's save function var node = get_node(node_data["path"]) - node.call("load", node_data) + if node != null: + node.call("load", node_data) + else: + print("Cannot load node ", node_data["path"]) save_game.close()