Fix T95640: missing null check in previous commit

This commit is contained in:
Jacques Lucke 2022-02-09 12:36:20 +01:00
parent fd6506626b
commit d82384f7e1
Notes: blender-bot 2023-02-14 09:09:43 +01:00
Referenced by issue #95640, BUG: Crash when connecting nodes due to recent change
1 changed files with 2 additions and 2 deletions

View File

@ -2453,12 +2453,12 @@ void ED_node_link_insert(Main *bmain, ScrArea *area)
bNodeSocket *best_output = get_main_socket(ntree, *node_to_insert, SOCK_OUT);
/* Ignore main sockets when the types don't match. */
if (best_input != nullptr &&
if (best_input != nullptr && ntree.typeinfo->validate_link != nullptr &&
!ntree.typeinfo->validate_link(static_cast<eNodeSocketDatatype>(old_link->fromsock->type),
static_cast<eNodeSocketDatatype>(best_input->type))) {
best_input = nullptr;
}
if (best_output != nullptr &&
if (best_output != nullptr && ntree.typeinfo->validate_link != nullptr &&
!ntree.typeinfo->validate_link(static_cast<eNodeSocketDatatype>(best_output->type),
static_cast<eNodeSocketDatatype>(old_link->tosock->type))) {
best_output = nullptr;