FileDialog: fix select index out of range

This commit is contained in:
Poommetee Ketson 2017-10-06 21:59:43 +07:00
parent d938de67ff
commit 5e67a3bca7
1 changed files with 3 additions and 2 deletions

View File

@ -115,7 +115,9 @@ Vector<String> FileDialog::get_selected_files() const {
void FileDialog::update_dir() {
dir->set_text(dir_access->get_current_dir());
drives->select(dir_access->get_current_drive());
if (drives->is_visible()) {
drives->select(dir_access->get_current_drive());
}
}
void FileDialog::_dir_entered(String p_dir) {
@ -667,7 +669,6 @@ void FileDialog::_update_drives() {
drives->show();
for (int i = 0; i < dir_access->get_drive_count(); i++) {
String d = dir_access->get_drive(i);
drives->add_item(dir_access->get_drive(i));
}