From 3a14c011f9fb35cf7432f6bc7f96cb18cacc8255 Mon Sep 17 00:00:00 2001 From: Antonio Vazquez Date: Fri, 15 May 2020 13:05:46 +0200 Subject: GPencil: Fix unreported crash using U key in Draw mode The problem was the preview could be not available when press the key. --- source/blender/editors/gpencil/gpencil_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'source/blender/editors/gpencil') diff --git a/source/blender/editors/gpencil/gpencil_utils.c b/source/blender/editors/gpencil/gpencil_utils.c index 03deab15b1e..407571d18c8 100644 --- a/source/blender/editors/gpencil/gpencil_utils.c +++ b/source/blender/editors/gpencil/gpencil_utils.c @@ -507,7 +507,7 @@ const EnumPropertyItem *ED_gpencil_material_enum_itemf(bContext *C, item_tmp.identifier = ma->id.name + 2; item_tmp.name = ma->id.name + 2; item_tmp.value = i; - item_tmp.icon = ma->preview->icon_id; + item_tmp.icon = ma->preview ? ma->preview->icon_id : ICON_NONE; RNA_enum_item_add(&item, &totitem, &item_tmp); } -- cgit v1.2.3