1
0
mirror of https://github.com/godotengine/godot.git synced 2025-11-17 14:11:06 +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

@@ -1099,16 +1099,18 @@ EditorFileDialog::Access EditorFileDialog::get_access() const {
}
void EditorFileDialog::_make_dir_confirm() {
if (EditorFileSystem::get_singleton()->get_filesystem_path(makedirname->get_text().strip_edges())) {
const String stripped_dirname = makedirname->get_text().strip_edges();
if (dir_access->dir_exists(stripped_dirname)) {
error_dialog->set_text(TTR("Could not create folder. File with that name already exists."));
error_dialog->popup_centered(Size2(250, 50) * EDSCALE);
makedirname->set_text(""); // Reset label.
return;
}
Error err = dir_access->make_dir(makedirname->get_text().strip_edges());
Error err = dir_access->make_dir(stripped_dirname);
if (err == OK) {
dir_access->change_dir(makedirname->get_text().strip_edges());
dir_access->change_dir(stripped_dirname);
invalidate();
update_filters();
update_dir();