summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkobewi <kobewi4e@gmail.com>2022-09-13 19:35:25 +0200
committerkobewi <kobewi4e@gmail.com>2022-09-13 19:36:22 +0200
commitae2d07d4ca7f2e73930702207f8bbb3dfaee26d3 (patch)
tree3349c7b8e59d7de3921479227f3094de3d5102af
parentf6b36f54e50cff518b4085cf665405ad1b5f6d44 (diff)
Don't print error on empty actions
-rw-r--r--editor/editor_undo_redo_manager.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/editor/editor_undo_redo_manager.cpp b/editor/editor_undo_redo_manager.cpp
index eca2b3143b..8c04a4d595 100644
--- a/editor/editor_undo_redo_manager.cpp
+++ b/editor/editor_undo_redo_manager.cpp
@@ -124,7 +124,7 @@ void EditorUndoRedoManager::create_action(const String &p_name, UndoRedo::MergeM
create_action_for_history(p_name, INVALID_HISTORY, p_mode);
if (p_custom_context) {
- // This assigns context to pending action.
+ // This assigns history to pending action.
get_history_for_object(p_custom_context);
}
}
@@ -218,7 +218,10 @@ void EditorUndoRedoManager::add_undo_reference(Object *p_object) {
}
void EditorUndoRedoManager::commit_action(bool p_execute) {
- ERR_FAIL_COND(pending_action.history_id == INVALID_HISTORY);
+ if (pending_action.history_id == INVALID_HISTORY) {
+ return; // Empty action, do nothing.
+ }
+
is_committing = true;
History &history = get_or_create_history(pending_action.history_id);