[Bf-blender-cvs] [837233d96a3] temp-T97479-3d-texturing-undo: Don't assume that there is a sculpt undo step.
Jeroen Bakker
noreply at git.blender.org
Wed May 11 10:31:23 CEST 2022
Commit: 837233d96a3d04963c41871d15021907c9fe7ee7
Author: Jeroen Bakker
Date: Wed May 11 10:30:57 2022 +0200
Branches: temp-T97479-3d-texturing-undo
https://developer.blender.org/rB837233d96a3d04963c41871d15021907c9fe7ee7
Don't assume that there is a sculpt undo step.
===================================================================
M source/blender/editors/sculpt_paint/sculpt_undo.c
===================================================================
diff --git a/source/blender/editors/sculpt_paint/sculpt_undo.c b/source/blender/editors/sculpt_paint/sculpt_undo.c
index 5867dc558de..40e1ba717f0 100644
--- a/source/blender/editors/sculpt_paint/sculpt_undo.c
+++ b/source/blender/editors/sculpt_paint/sculpt_undo.c
@@ -1783,6 +1783,7 @@ void ED_sculpt_undosys_type(UndoType *ut)
static UndoSculpt *sculpt_undosys_step_get_nodes(UndoStep *us_p)
{
+ BLI_assert(us_p != NULL);
SculptUndoStep *us = (SculptUndoStep *)us_p;
return &us->data;
}
@@ -1791,6 +1792,9 @@ static UndoSculpt *sculpt_undo_get_nodes(void)
{
UndoStack *ustack = ED_undo_stack_get();
UndoStep *us = BKE_undosys_stack_init_or_active_with_type(ustack, BKE_UNDOSYS_TYPE_SCULPT);
+ if (us == NULL) {
+ return NULL;
+ }
return sculpt_undosys_step_get_nodes(us);
}
More information about the Bf-blender-cvs
mailing list