Fix more crashes attempting to run operators in unexpected contexts
Add missing NULL checks for: - OBJECT_OT_transform_to_mouse - GPENCIL_OT_time_segment_remove
This commit is contained in:
@@ -4031,7 +4031,7 @@ static int object_transform_to_mouse_exec(bContext *C, wmOperator *op)
|
||||
|
||||
MEM_freeN(objects);
|
||||
}
|
||||
else {
|
||||
else if (CTX_wm_region_view3d(C)) {
|
||||
int mval[2];
|
||||
if (object_add_drop_xy_get(C, op, &mval)) {
|
||||
float cursor[3];
|
||||
|
||||
@@ -1024,6 +1024,9 @@ static int time_segment_remove_exec(bContext *C, wmOperator *op)
|
||||
TimeGpencilModifierData *gpmd = (TimeGpencilModifierData *)gpencil_edit_modifier_property_get(
|
||||
op, ob, eGpencilModifierType_Time);
|
||||
|
||||
if (gpmd == NULL) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
if (gpmd->segment_active_index < 0 || gpmd->segment_active_index >= gpmd->segments_len) {
|
||||
return OPERATOR_CANCELLED;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user