Fix #23431: crash in brush icon preview when there is no active object.

This commit is contained in:
Brecht Van Lommel 2010-08-22 10:17:31 +00:00
parent de35361b11
commit 4e4b797165

@ -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;
}