mirror of
https://github.com/blender/blender
synced 2026-09-29 04:37:17 +03:00
Fix crash in grease pencil snap without a window region
Add window region check to the poll function.
This commit is contained in:
parent
991d48a9ed
commit
9c421cbef2
1 changed files with 10 additions and 2 deletions
|
|
@ -3359,8 +3359,16 @@ static bool grease_pencil_snap_poll(bContext *C)
|
|||
return false;
|
||||
}
|
||||
|
||||
ScrArea *area = CTX_wm_area(C);
|
||||
return (area != nullptr) && (area->spacetype == SPACE_VIEW3D);
|
||||
const ScrArea *area = CTX_wm_area(C);
|
||||
if (!(area && area->spacetype == SPACE_VIEW3D)) {
|
||||
return false;
|
||||
}
|
||||
const ARegion *region = CTX_wm_region(C);
|
||||
if (!(region && region->regiontype == RGN_TYPE_WINDOW)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
static wmOperatorStatus grease_pencil_snap_to_grid_exec(bContext *C, wmOperator * /*op*/)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue