From 2b0fcdde3144213676324163d721150a8641d610 Mon Sep 17 00:00:00 2001 From: Star Rauchenberger Date: Wed, 29 May 2024 13:34:00 -0400 Subject: Gracefully handle corrupted data files --- Archipelago/client.gd | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'Archipelago') diff --git a/Archipelago/client.gd b/Archipelago/client.gd index e89c156..bc952b9 100644 --- a/Archipelago/client.gd +++ b/Archipelago/client.gd @@ -133,6 +133,10 @@ func _init(): var data = file.get_var(true) file.close() + if typeof(data) != TYPE_ARRAY: + global._print("AP settings file is corrupted") + data = [] + if data.size() > 0: ap_server = data[0] if data.size() > 1: @@ -328,6 +332,10 @@ func _on_data(): var localdata = ap_file.get_var(true) ap_file.close() + if typeof(localdata) != TYPE_ARRAY: + global._print("AP localdata file is corrupted") + localdata = [] + if localdata.size() > 0: _last_new_item = localdata[0] else: -- cgit 1.4.1