summaryrefslogtreecommitdiff
path: root/core/undo_redo.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'core/undo_redo.cpp')
-rw-r--r--core/undo_redo.cpp11
1 files changed, 5 insertions, 6 deletions
diff --git a/core/undo_redo.cpp b/core/undo_redo.cpp
index 6bc882eaec..00894b41d8 100644
--- a/core/undo_redo.cpp
+++ b/core/undo_redo.cpp
@@ -234,7 +234,9 @@ void UndoRedo::_pop_history_tail() {
}
actions.remove(0);
- current_action--;
+ if (current_action >= 0) {
+ current_action--;
+ }
}
void UndoRedo::commit_action() {
@@ -258,11 +260,8 @@ void UndoRedo::_process_operation_list(List<Operation>::Element *E) {
Operation &op = E->get();
Object *obj = ObjectDB::get_instance(op.object);
- if (!obj) {
- //corruption
- clear_history();
- ERR_FAIL_COND(!obj);
- }
+ if (!obj) //may have been deleted and this is fine
+ continue;
switch (op.type) {