Fix: potential crash from null pointer dereference

Null check the operator member as this is documented to be null
and is checked elsewhere in the handler logic.

Co-authored-by: Kabinet0 <m3kabin@gmail.com>

Ref !137506
This commit is contained in:
Campbell Barton
2025-04-23 22:53:28 +10:00
parent 45db049073
commit 9356b12bd5

View File

@@ -2552,8 +2552,10 @@ static void wm_handler_operator_insert(wmWindow *win, wmEventHandler_Op *handler
LISTBASE_FOREACH (wmEventHandler *, handler_iter, &win->modalhandlers) {
if (handler_iter->type == WM_HANDLER_TYPE_OP) {
wmEventHandler_Op *handler_iter_op = (wmEventHandler_Op *)handler_iter;
if (handler_iter_op->op->type->flag & OPTYPE_MODAL_PRIORITY) {
last_priority_handler = handler_iter;
if (handler_iter_op->op != nullptr) {
if (handler_iter_op->op->type->flag & OPTYPE_MODAL_PRIORITY) {
last_priority_handler = handler_iter;
}
}
}
}