Browse Source

Fix file dialog crash on forward click when history is empty.

bruvzg 2 years ago
parent
commit
5eeefb2174
2 changed files with 2 additions and 2 deletions
  1. 1 1
      editor/editor_file_dialog.cpp
  2. 1 1
      scene/gui/file_dialog.cpp

+ 1 - 1
editor/editor_file_dialog.cpp

@@ -1500,7 +1500,7 @@ void EditorFileDialog::_go_back() {
 }
 
 void EditorFileDialog::_go_forward() {
-	if (local_history_pos == local_history.size() - 1) {
+	if (local_history_pos >= local_history.size() - 1) {
 		return;
 	}
 

+ 1 - 1
scene/gui/file_dialog.cpp

@@ -411,7 +411,7 @@ void FileDialog::_go_back() {
 }
 
 void FileDialog::_go_forward() {
-	if (local_history_pos == local_history.size() - 1) {
+	if (local_history_pos >= local_history.size() - 1) {
 		return;
 	}