Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacques Lucke <jacques@blender.org>2021-10-22 12:52:51 +0300
committerJacques Lucke <jacques@blender.org>2021-10-22 12:56:19 +0300
commit675a22b3415919740d7adc01d823b9507e30a918 (patch)
treefdb6a8c024806d3b91395db010b32f15673e87c1 /source/blender/editors/space_node/drawnode.cc
parent1133b1478e237b252af033c04628de738d337a5f (diff)
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.
Diffstat (limited to 'source/blender/editors/space_node/drawnode.cc')
-rw-r--r--source/blender/editors/space_node/drawnode.cc4
1 files changed, 3 insertions, 1 deletions
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]);
}