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

Fix Project Manager hard crashes due to invalid access to Editor Nodes

This commit is contained in:
Marios Staikopoulos
2022-04-05 10:09:52 -07:00
parent 77843355a0
commit da2b5da0c5
3 changed files with 19 additions and 14 deletions

View File

@@ -156,15 +156,18 @@ void EditorDirDialog::_make_dir_confirm() {
String dir = ti->get_metadata(0);
if (EditorFileSystem::get_singleton()->get_filesystem_path(dir + makedirname->get_text())) {
DirAccessRef d = DirAccess::open(dir);
ERR_FAIL_COND_MSG(!d, "Cannot open directory '" + dir + "'.");
const String stripped_dirname = makedirname->get_text().strip_edges();
if (d->dir_exists(stripped_dirname)) {
mkdirerr->set_text(TTR("Could not create folder. File with that name already exists."));
mkdirerr->popup_centered();
return;
}
DirAccessRef d = DirAccess::open(dir);
ERR_FAIL_COND_MSG(!d, "Cannot open directory '" + dir + "'.");
Error err = d->make_dir(makedirname->get_text());
Error err = d->make_dir(stripped_dirname);
if (err != OK) {
mkdirerr->popup_centered(Size2(250, 80) * EDSCALE);
} else {