GPencil: Fix unreported crash using U key in Draw mode

The problem was the preview could be not available when press the key.
This commit is contained in:
Antonio Vazquez 2020-05-15 13:05:46 +02:00
parent 04517ee936
commit 3a14c011f9
1 changed files with 1 additions and 1 deletions

View File

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