Check whether a directory exists before trying to open it.

This commit is contained in:
Relintai 2023-10-09 14:23:06 +02:00
parent a6303e2dc7
commit 7b08a43faa

View File

@ -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()