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
Notes: blender-bot 2023-02-14 05:43:12 +01:00
Referenced by issue #56507, Crash
Referenced by issue #55507, Add missing font
1 changed files with 1 additions and 1 deletions

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;