From 7b08a43faae2a979e4b1e70e720dcf0a4ffd525b Mon Sep 17 00:00:00 2001 From: Relintai Date: Mon, 9 Oct 2023 14:23:06 +0200 Subject: [PATCH] Check whether a directory exists before trying to open it. --- .../import_export/formats_edit/edit_tres.gd | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/addons/resources_speadsheet_view/import_export/formats_edit/edit_tres.gd b/addons/resources_speadsheet_view/import_export/formats_edit/edit_tres.gd index 28ed7d0..5f26425 100644 --- a/addons/resources_speadsheet_view/import_export/formats_edit/edit_tres.gd +++ b/addons/resources_speadsheet_view/import_export/formats_edit/edit_tres.gd @@ -53,7 +53,11 @@ func has_row_names(): func import_from_path(folderpath : String, insert_func : FuncRef, sort_by : String, sort_reverse : bool = false) -> Array: var rows := [] - var dir := Directory.new() + var dir : Directory = Directory.new() + + if !dir.dir_exists(folderpath): + return Array() + dir.open(folderpath) dir.list_dir_begin()