Page MenuHome

Fix T91411: Outliner crash using contextmenu operators from a shortcut
ClosedPublic

Authored by Philipp Oeser (lichtwerk) on Sep 15 2021, 8:45 AM.

Details

Summary

Oversight in rBb0741e1dcbc5: Outliner: Use right click target element for context menu.

This was guarded by an assert in get_target_element, but it can be
valid to have these assigned to a shortcut (and then perform the action
without an active outliner element).

Now remove the assert and let the operator polls check if we really have
a target element.

note: this basically makes get_target_element obsolete, could call
outliner_find_element_with_flag instead in a ll cases.

Diff Detail

Repository
rB Blender
Branch
T91411 (branched from master)
Build Status
Buildable 18182
Build 18182: arc lint + arc unit

Event Timeline

Philipp Oeser (lichtwerk) requested review of this revision.Sep 15 2021, 8:45 AM
Philipp Oeser (lichtwerk) created this revision.

I'd prefer if the poll() function always checks if there's an active element, at least if this isn't continuously called while the menu is open (which I think it isn't, just something to double-check).
But the invoke()/exec() callbacks can then assume there is one.

This revision is now accepted and ready to land.Oct 25 2021, 12:46 PM