From 5eeefb2174a1144f728cfc7d31aee9e975377b62 Mon Sep 17 00:00:00 2001 From: bruvzg <7645683+bruvzg@users.noreply.github.com> Date: Tue, 3 Jan 2023 10:23:49 +0200 Subject: [PATCH] Fix file dialog crash on forward click when history is empty. --- editor/editor_file_dialog.cpp | 2 +- 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 55c512f77db..a9c46d4d94e 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 11a3803b359..a846ab9485b 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; }