[Bf-blender-cvs] [3a14c011f9f] master: GPencil: Fix unreported crash using U key in Draw mode
Antonio Vazquez
noreply at git.blender.org
Fri May 15 13:06:03 CEST 2020
Commit: 3a14c011f9fb35cf7432f6bc7f96cb18cacc8255
Author: Antonio Vazquez
Date: Fri May 15 13:05:46 2020 +0200
Branches: master
https://developer.blender.org/rB3a14c011f9fb35cf7432f6bc7f96cb18cacc8255
GPencil: Fix unreported crash using U key in Draw mode
The problem was the preview could be not available when press the key.
===================================================================
M source/blender/editors/gpencil/gpencil_utils.c
===================================================================
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);
}
More information about the Bf-blender-cvs
mailing list