Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't print error on empty actions #65754

Merged
merged 1 commit into from
Sep 13, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions editor/editor_undo_redo_manager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is leftover from before I renamed "context" to "history".

get_history_for_object(p_custom_context);
}
}
Expand Down Expand Up @@ -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);
Expand Down