From 676d995d2965f8c452351f6e57191eb9ab901e44 Mon Sep 17 00:00:00 2001 From: Jacques Lucke Date: Tue, 25 Aug 2020 11:23:35 +0200 Subject: Fix T79915: crash when changing to white noise texture Reviewers: brecht, OmarSquircleArt Differential Revision: https://developer.blender.org/D8697 --- source/blender/editors/space_node/node_templates.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'source') diff --git a/source/blender/editors/space_node/node_templates.c b/source/blender/editors/space_node/node_templates.c index 7d4095326f8..2d4aa197242 100644 --- a/source/blender/editors/space_node/node_templates.c +++ b/source/blender/editors/space_node/node_templates.c @@ -282,7 +282,9 @@ static void node_socket_add_replace(const bContext *C, /* also preserve mapping for texture nodes */ if (node_from->typeinfo->nclass == NODE_CLASS_TEXTURE && - node_prev->typeinfo->nclass == NODE_CLASS_TEXTURE) { + node_prev->typeinfo->nclass == NODE_CLASS_TEXTURE && + /* White noise texture node does not have NodeTexBase. */ + node_from->storage != NULL && node_prev->storage != NULL) { memcpy(node_from->storage, node_prev->storage, sizeof(NodeTexBase)); } -- cgit v1.2.3