Fix T67040: Undo crashes after renaming
authorCampbell Barton <ideasman42@gmail.com>
Tue, 16 Jul 2019 07:14:19 +0000 (17:14 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 16 Jul 2019 07:14:19 +0000 (17:14 +1000)
Caused by error keeping the first memfile undo step.

source/blender/blenkernel/intern/undo_system.c

index d312dc0190b41019fde1ea4900d3553221832739..2d0a482d2232720dae7ab32ab28454c3856aecd0 100644 (file)
@@ -427,7 +427,7 @@ void BKE_undosys_stack_limit_steps_and_memory(UndoStack *ustack, int steps, size
     /* Hack, we need to keep at least one BKE_UNDOSYS_TYPE_MEMFILE. */
     if (us->type != BKE_UNDOSYS_TYPE_MEMFILE) {
       us_exclude = us->prev;
-      while (us_exclude && us->type != BKE_UNDOSYS_TYPE_MEMFILE) {
+      while (us_exclude && us_exclude->type != BKE_UNDOSYS_TYPE_MEMFILE) {
         us_exclude = us_exclude->prev;
       }
       if (us_exclude) {