diff options
Diffstat (limited to 'source/blender/blenkernel/intern/undo_system.c')
-rw-r--r-- | source/blender/blenkernel/intern/undo_system.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/source/blender/blenkernel/intern/undo_system.c b/source/blender/blenkernel/intern/undo_system.c index 9c7e226007a..e5d2d4a9f0b 100644 --- a/source/blender/blenkernel/intern/undo_system.c +++ b/source/blender/blenkernel/intern/undo_system.c @@ -675,9 +675,11 @@ bool BKE_undosys_step_undo_with_data_ex(UndoStack *ustack, bool use_skip) { UNDO_NESTED_ASSERT(false); - if (us) { - undosys_stack_validate(ustack, true); + if (us == NULL) { + return false; } + undosys_stack_validate(ustack, true); + UndoStep *us_prev = us ? us->prev : NULL; if (us) { /* The current state is a copy, we need to load the previous state. */ @@ -753,6 +755,11 @@ bool BKE_undosys_step_redo_with_data_ex(UndoStack *ustack, bool use_skip) { UNDO_NESTED_ASSERT(false); + if (us == NULL) { + return false; + } + undosys_stack_validate(ustack, true); + UndoStep *us_next = us ? us->next : NULL; /* Unlike undo accumulate, we always use the next. */ us = us_next; |