Fix #116275: Snap (align to target) crash without valid target location

Caused by 9c2e768f5b

Since above commit, drawing of the normal is not done in
`ED_view3d_cursor_snap_draw_util` anymore [that function checked the
existence of a valid target location], now add the check back.

Pull Request: https://projects.blender.org/blender/blender/pulls/116292
This commit is contained in:
Philipp Oeser
2023-12-18 14:18:39 +01:00
committed by Philipp Oeser
parent e1cec452da
commit f2cd1873ea

View File

@@ -270,7 +270,7 @@ void drawSnapping(TransInfo *t)
rv3d, source_loc, target_loc, t->tsnap.source_type, t->tsnap.target_type, col, activeCol);
/* Draw normal if needed. */
if (usingSnappingNormal(t) && validSnappingNormal(t)) {
if (usingSnappingNormal(t) && validSnappingNormal(t) && target_loc) {
uint pos = GPU_vertformat_attr_add(
immVertexFormat(), "pos", GPU_COMP_F32, 3, GPU_FETCH_FLOAT);