Fix #118524: Loopcut crashes when not near an edge #118549

Merged
Philipp Oeser merged 1 commits from lichtwerk/blender:118524 into main 2024-02-21 12:38:16 +01:00

1 Commits

Author SHA1 Message Date
Philipp Oeser 99232785bc Fix #118524: Loopcut crashes when not near an edge
Caused by 1c0f374ec3

When `EDBM_edge_find_nearest_ex` does not find a nearest edge in
`loopcut_mouse_move`, then  `loopcut_update_edge` will set
`RingSelOpData` `ob` to nullptr (rightfully so).

This would then crash in `ringsel_draw` (because we are trying to call
`object_to_world()` on the nullptr.

Prior to 1c0f374ec3 this was also "wrong", but
`EDBM_preselect_edgering_draw` would early out before using garbage
data.

Now guard against this and dont call `EDBM_preselect_edgering_draw` at
all if we dont have valid input.
2024-02-21 10:01:23 +01:00