Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAntonio Vazquez <blendergit@gmail.com>2021-12-28 18:07:07 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-12-28 18:07:07 +0300
commitbd9d09ca829994ef30fb29debbb78612bdf9e3bd (patch)
tree5273740c147707f0d1725bc523a4040a00195cda /source/blender/editors/gpencil
parent9bacd543124e6fb971842b3fbf0e03079f7da3d7 (diff)
Fix T94439: Some GPencil operators crash when calling from console
This fix avoid the segment fault for several operators.
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_mesh.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_mesh.c b/source/blender/editors/gpencil/gpencil_mesh.c
index 11e02b9832f..efe29e852f2 100644
--- a/source/blender/editors/gpencil/gpencil_mesh.c
+++ b/source/blender/editors/gpencil/gpencil_mesh.c
@@ -142,6 +142,9 @@ static bool gpencil_bake_ob_list(bContext *C, Depsgraph *depsgraph, Scene *scene
/* Add active object. In some files this could not be in selected array. */
Object *obact = CTX_data_active_object(C);
+ if (obact == NULL) {
+ return false;
+ }
if (obact->type == OB_MESH) {
elem = MEM_callocN(sizeof(GpBakeOb), __func__);