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 20:49:42 +0300
committerAntonio Vazquez <blendergit@gmail.com>2021-12-28 20:50:07 +0300
commitd7c556de32f2cb8c90e8be0943cd6c1f8169e4de (patch)
tree400c54b6ddd3419bf50f4d7da75fe9880e86195d /source/blender/editors/gpencil
parent2e6ae113263d429ca3c933a5e869a48c81994867 (diff)
GPencil: Avoid crashes calling from python
This is part of T94439
Diffstat (limited to 'source/blender/editors/gpencil')
-rw-r--r--source/blender/editors/gpencil/gpencil_data.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/source/blender/editors/gpencil/gpencil_data.c b/source/blender/editors/gpencil/gpencil_data.c
index bea8126cfcc..916aa8184aa 100644
--- a/source/blender/editors/gpencil/gpencil_data.c
+++ b/source/blender/editors/gpencil/gpencil_data.c
@@ -1468,6 +1468,10 @@ static int gpencil_layer_change_invoke(bContext *C, wmOperator *op, const wmEven
static int gpencil_layer_change_exec(bContext *C, wmOperator *op)
{
bGPdata *gpd = CTX_data_gpencil_data(C);
+ if (gpd == NULL) {
+ return OPERATOR_CANCELLED;
+ }
+
bGPDlayer *gpl = NULL;
int layer_num = RNA_enum_get(op->ptr, "layer");