diff options
author | Campbell Barton <campbell@blender.org> | 2022-08-28 13:08:18 +0300 |
---|---|---|
committer | Campbell Barton <campbell@blender.org> | 2022-08-28 13:18:12 +0300 |
commit | 7de290ea086cbcd063a2d5668a74e0f23bc28339 (patch) | |
tree | 175c9960d0fc04a7b0553c0195f7aba97d3abe3d /source/blender/editors/interface | |
parent | 219d1095756fda2e54b6168eb65c93e3869722a6 (diff) |
Fix crashes running operators in invalid contexts
Fix for running operators outside of expected contexts.
- UI_OT_view_drop (poll)
- UI_OT_view_item_rename (poll)
- OBJECT_OT_gpencil_modifier_move_to_index
- OBJECT_OT_modifier_move_to_index
- OBJECT_OT_geometry_nodes_input_attribute_toggle
- OBJECT_OT_geometry_node_tree_copy_assign
- OBJECT_OT_shaderfx_remove
- OBJECT_OT_shaderfx_copy
- POSE_OT_relax (& other pose slide operators).
Diffstat (limited to 'source/blender/editors/interface')
-rw-r--r-- | source/blender/editors/interface/interface_ops.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/source/blender/editors/interface/interface_ops.c b/source/blender/editors/interface/interface_ops.c index 3a5ba9acaac..865aed01aa1 100644 --- a/source/blender/editors/interface/interface_ops.c +++ b/source/blender/editors/interface/interface_ops.c @@ -2339,6 +2339,9 @@ static bool ui_view_drop_poll(bContext *C) { const wmWindow *win = CTX_wm_window(C); const ARegion *region = CTX_wm_region(C); + if (region == NULL) { + return false; + } const uiViewItemHandle *hovered_item = UI_region_views_find_item_at(region, win->eventstate->xy); return hovered_item != NULL; @@ -2386,6 +2389,9 @@ static void UI_OT_view_drop(wmOperatorType *ot) static bool ui_view_item_rename_poll(bContext *C) { const ARegion *region = CTX_wm_region(C); + if (region == NULL) { + return false; + } const uiViewItemHandle *active_item = UI_region_views_find_active_item(region); return active_item != NULL && UI_view_item_can_rename(active_item); } |