GPencil: Avoid crashes calling from python
This is part of T94439
This commit is contained in:
parent
2e6ae11326
commit
d7c556de32
|
@ -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");
|
||||
|
||||
|
|
|
@ -533,6 +533,10 @@ static GpencilModifierData *gpencil_edit_modifier_property_get(wmOperator *op,
|
|||
Object *ob,
|
||||
int type)
|
||||
{
|
||||
if (ob == NULL) {
|
||||
return NULL;
|
||||
}
|
||||
|
||||
char modifier_name[MAX_NAME];
|
||||
GpencilModifierData *md;
|
||||
RNA_string_get(op->ptr, "modifier", modifier_name);
|
||||
|
|
Loading…
Reference in New Issue