diff options
Diffstat (limited to 'source/blender/editors/sculpt_paint/paint_undo.c')
-rw-r--r-- | source/blender/editors/sculpt_paint/paint_undo.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/source/blender/editors/sculpt_paint/paint_undo.c b/source/blender/editors/sculpt_paint/paint_undo.c index 9bc6cacbb16..05f2b565e82 100644 --- a/source/blender/editors/sculpt_paint/paint_undo.c +++ b/source/blender/editors/sculpt_paint/paint_undo.c @@ -191,10 +191,14 @@ void undo_paint_push_begin(int type, char *name, UndoRestoreCb restore, UndoFree ListBase *undo_paint_push_get_list(int type) { - if(type == UNDO_PAINT_IMAGE) - return &ImageUndoStack.current->elems; - else if(type == UNDO_PAINT_MESH) - return &MeshUndoStack.current->elems; + if(type == UNDO_PAINT_IMAGE) { + if(ImageUndoStack.current) + return &ImageUndoStack.current->elems; + } + else if(type == UNDO_PAINT_MESH) { + if(MeshUndoStack.current) + return &MeshUndoStack.current->elems; + } return NULL; } |