mirror of
https://github.com/Relintai/godot-resources-as-sheets-plugin.git
synced 2024-11-18 20:27:20 +01:00
Check whether a directory exists before trying to open it.
This commit is contained in:
parent
a6303e2dc7
commit
7b08a43faa
@ -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()
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user