diff --git a/source/blender/editors/interface/interface_icons.c b/source/blender/editors/interface/interface_icons.c index 3ba7c654210..499c676bf6f 100644 --- a/source/blender/editors/interface/interface_icons.c +++ b/source/blender/editors/interface/interface_icons.c @@ -1027,11 +1027,11 @@ static int ui_id_brush_get_icon(bContext *C, ID *id, int preview) EnumPropertyItem *items; int tool; - if(ob->mode & OB_MODE_SCULPT) { + if(ob && (ob->mode & OB_MODE_SCULPT)) { items = brush_sculpt_tool_items; tool = br->sculpt_tool; } - else if(ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT)) { + else if(ob && (ob->mode & (OB_MODE_VERTEX_PAINT|OB_MODE_WEIGHT_PAINT))) { items = brush_vertexpaint_tool_items; tool = br->vertexpaint_tool; }