[Bf-blender-cvs] [77516c25e48] master: GPencil: Fix segment fault using Search menu

Antonio Vazquez noreply at git.blender.org
Sat Aug 10 10:20:38 CEST 2019


Commit: 77516c25e48d77bf2593b4dd13ef74e3737d0502
Author: Antonio Vazquez
Date:   Sat Aug 10 10:20:30 2019 +0200
Branches: master
https://developer.blender.org/rB77516c25e48d77bf2593b4dd13ef74e3737d0502

GPencil: Fix segment fault using Search menu

The poll was not checking Object type

===================================================================

M	source/blender/editors/gpencil/gpencil_edit.c

===================================================================

diff --git a/source/blender/editors/gpencil/gpencil_edit.c b/source/blender/editors/gpencil/gpencil_edit.c
index 01b62dce3c2..f3ab0b45122 100644
--- a/source/blender/editors/gpencil/gpencil_edit.c
+++ b/source/blender/editors/gpencil/gpencil_edit.c
@@ -4575,7 +4575,7 @@ bool ED_object_gpencil_exit(struct Main *bmain, Object *ob)
 static bool gp_merge_by_distance_poll(bContext *C)
 {
   Object *ob = CTX_data_active_object(C);
-  if (ob == NULL) {
+  if ((ob == NULL) || (ob->type != OB_GPENCIL)) {
     return false;
   }
   bGPdata *gpd = (bGPdata *)ob->data;



More information about the Bf-blender-cvs mailing list