1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-04 12:00:25 +00:00

Add error checks for DirAccess creation.

This commit is contained in:
Saracen
2023-09-26 03:07:43 +01:00
parent 43b9e89a07
commit 3f4513d4de
10 changed files with 26 additions and 0 deletions

View File

@@ -5954,6 +5954,7 @@ void EditorNode::_dropped_files(const Vector<String> &p_files) {
void EditorNode::_add_dropped_files_recursive(const Vector<String> &p_files, String to_path) {
Ref<DirAccess> dir = DirAccess::create(DirAccess::ACCESS_FILESYSTEM);
ERR_FAIL_COND(dir.is_null());
for (int i = 0; i < p_files.size(); i++) {
String from = p_files[i];
@@ -5963,6 +5964,8 @@ void EditorNode::_add_dropped_files_recursive(const Vector<String> &p_files, Str
Vector<String> sub_files;
Ref<DirAccess> sub_dir = DirAccess::open(from);
ERR_FAIL_COND(sub_dir.is_null());
sub_dir->list_dir_begin();
String next_file = sub_dir->get_next();