From 675a22b3415919740d7adc01d823b9507e30a918 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Fri, 22 Oct 2021 11:52:51 +0200 Subject: Nodes: fix link drawing for some socket types The type of sockets is `-1` in some cases, resulting in a crash when accessing the `std_node_socket_colors` array. --- source/blender/editors/space_node/drawnode.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source/blender/editors/space_node/drawnode.cc') diff --git a/source/blender/editors/space_node/drawnode.cc b/source/blender/editors/space_node/drawnode.cc index 7bb35ab37d5..5117544aba8 100644 --- a/source/blender/editors/space_node/drawnode.cc +++ b/source/blender/editors/space_node/drawnode.cc @@ -4262,7 +4262,9 @@ void node_draw_link_bezier(const View2D *v2d, } if (snode->overlay.flag & SN_OVERLAY_SHOW_OVERLAYS && - snode->overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS) { + snode->overlay.flag & SN_OVERLAY_SHOW_WIRE_COLORS && + ((link->fromsock == nullptr || link->fromsock->typeinfo->type >= 0) && + (link->tosock == nullptr || link->tosock->typeinfo->type >= 0))) { if (link->fromsock) { copy_v4_v4(colors[1], std_node_socket_colors[link->fromsock->typeinfo->type]); } -- cgit v1.2.3