Fix T56666: Crash typing "w" in the search function.

One shall check object is a GPencil one, before trying to use ob->data...
This commit is contained in:
Bastien Montagne 2018-09-03 16:05:57 +02:00
parent 101b2ce7b6
commit f922881620
Notes: blender-bot 2023-02-14 10:29:30 +01:00
Referenced by issue #56666, Crash typing "w" in the search function
1 changed files with 5 additions and 0 deletions

View File

@ -527,6 +527,11 @@ bool ED_gpencil_add_armature_weights(
static bool gpencil_generate_weights_poll(bContext *C)
{
Object *ob = CTX_data_active_object(C);
if (ob->type != OB_GPENCIL) {
return false;
}
ViewLayer *view_layer = CTX_data_view_layer(C);
bGPdata *gpd = (bGPdata *)ob->data;