Fix #111212: Error running search if cursor is outside Blender window #111254

Closed
Christoph Lendenfeld wants to merge 5 commits from ChrisLend:fix_main_window_search_crash into main

When changing the target branch, be careful to rebase the branch in your fork to match. See documentation.
2 changed files with 7 additions and 1 deletions

View File

@ -266,6 +266,9 @@ class NewGeometryNodeGroupTool(Operator):
@classmethod
def poll(cls, context):
if not context.space_data:
# Does not exist if the search menu is called while the cursor is outside the Blender window.
return False
return context.space_data.type == 'NODE_EDITOR' and context.space_data.geometry_nodes_type == 'TOOL'
def execute(self, context):

View File

@ -3240,7 +3240,10 @@ static int keyframe_jump_exec(bContext *C, wmOperator *op)
static bool keyframe_jump_poll(bContext *C)
{
/* There is a keyframe jump operator specifically for the Graph Editor. */
return ED_operator_screenactive_norender(C) && CTX_wm_area(C)->spacetype != SPACE_GRAPH;
ScrArea *area = CTX_wm_area(C);
/* The area can be a nullptr when the search menu is called while the cursor is outside the
* blender window. */
return ED_operator_screenactive_norender(C) && (!area || area->spacetype != SPACE_GRAPH);
}
static void SCREEN_OT_keyframe_jump(wmOperatorType *ot)