Fix: crash when creating new node links

This was a regression in rBc27ef1e9e8e663e02173e518c1e669e9845b3d1f.
This commit is contained in:
Jacques Lucke 2021-07-15 12:43:03 +02:00
parent ae30f72c80
commit 2e8641e45e
1 changed files with 4 additions and 0 deletions

View File

@ -1232,6 +1232,10 @@ int node_find_indicated_socket(
float node_link_dim_factor(const View2D *v2d, const bNodeLink *link)
{
if (link->fromsock == nullptr || link->tosock == nullptr) {
return 1.0f;
}
const float min_endpoint_distance = std::min(
std::max(BLI_rctf_length_x(&v2d->cur, link->fromsock->locx),
BLI_rctf_length_y(&v2d->cur, link->fromsock->locy)),