diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-03 12:41:10 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2023-01-03 12:41:10 +0100 |
commit | 55ef81547215e00b2f90ec91cc11071d21e60239 (patch) | |
tree | a39926d72de53c8832e0ec82caa74c2e6a43f5c8 | |
parent | 7fb6d70398de19ed71dcf802f906ce7e6f93f674 (diff) | |
parent | 5eeefb2174a1144f728cfc7d31aee9e975377b62 (diff) |
Merge pull request #70865 from bruvzg/fd_crash
Fix file dialog crash on forward click when history is empty.
-rw-r--r-- | editor/editor_file_dialog.cpp | 2 | ||||
-rw-r--r-- | scene/gui/file_dialog.cpp | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/editor/editor_file_dialog.cpp b/editor/editor_file_dialog.cpp index 55c512f77d..a9c46d4d94 100644 --- a/editor/editor_file_dialog.cpp +++ b/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; } diff --git a/scene/gui/file_dialog.cpp b/scene/gui/file_dialog.cpp index 11a3803b35..a846ab9485 100644 --- a/scene/gui/file_dialog.cpp +++ b/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; } |