Fix T55507: Crash due to GPencil brush icon management, when there is no active object.

This commit is contained in:
Bastien Montagne
2018-08-23 21:56:11 +02:00
parent 4cde92303f
commit 13ac92d057

View File

@@ -1636,7 +1636,7 @@ static int ui_id_brush_get_icon(const bContext *C, ID *id)
}
/* reset the icon */
if (ob->mode & OB_MODE_GPENCIL_PAINT) {
if (ob != NULL && ob->mode & OB_MODE_GPENCIL_PAINT) {
switch (br->gpencil_settings->icon_id) {
case GP_BRUSH_ICON_PENCIL:
br->id.icon_id = ICON_GPBRUSH_PENCIL;