Fix T103463: Repeat last crashes in node editor
ae886596a0
tried to retrieve keymap data from a null pointer.
This commit is contained in:
parent
7be5ca63ae
commit
6b9825e6f7
Notes:
blender-bot
2023-02-14 08:42:53 +01:00
Referenced by issue #103463, Regression: Repeating last (shift + r) in node editor crashes blender
|
@ -1871,25 +1871,26 @@ bool initTransform(bContext *C, TransInfo *t, wmOperator *op, const wmEvent *eve
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (t->data_type == &TransConvertType_Node) {
|
||||
/* Set the initial auto-attach flag based on whether the chosen keymap key is pressed at the
|
||||
* start of the operator. */
|
||||
t->modifiers |= MOD_NODE_ATTACH;
|
||||
LISTBASE_FOREACH (const wmKeyMapItem *, kmi, &t->keymap->items) {
|
||||
if (kmi->flag & KMI_INACTIVE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (kmi->propvalue == TFM_MODAL_NODE_ATTACH_OFF && kmi->val == KM_PRESS) {
|
||||
if ((ELEM(kmi->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY) && (event->modifier & KM_CTRL)) ||
|
||||
(ELEM(kmi->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY) &&
|
||||
(event->modifier & KM_SHIFT)) ||
|
||||
(ELEM(kmi->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY) && (event->modifier & KM_ALT)) ||
|
||||
((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) {
|
||||
t->modifiers &= ~MOD_NODE_ATTACH;
|
||||
if (t->data_type == &TransConvertType_Node) {
|
||||
/* Set the initial auto-attach flag based on whether the chosen keymap key is pressed at the
|
||||
* start of the operator. */
|
||||
t->modifiers |= MOD_NODE_ATTACH;
|
||||
LISTBASE_FOREACH (const wmKeyMapItem *, kmi, &t->keymap->items) {
|
||||
if (kmi->flag & KMI_INACTIVE) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (kmi->propvalue == TFM_MODAL_NODE_ATTACH_OFF && kmi->val == KM_PRESS) {
|
||||
if ((ELEM(kmi->type, EVT_LEFTCTRLKEY, EVT_RIGHTCTRLKEY) &&
|
||||
(event->modifier & KM_CTRL)) ||
|
||||
(ELEM(kmi->type, EVT_LEFTSHIFTKEY, EVT_RIGHTSHIFTKEY) &&
|
||||
(event->modifier & KM_SHIFT)) ||
|
||||
(ELEM(kmi->type, EVT_LEFTALTKEY, EVT_RIGHTALTKEY) && (event->modifier & KM_ALT)) ||
|
||||
((kmi->type == EVT_OSKEY) && (event->modifier & KM_OSKEY))) {
|
||||
t->modifiers &= ~MOD_NODE_ATTACH;
|
||||
}
|
||||
break;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue