Skip to content

Commit

Permalink
Add empty vector check to node paste
Browse files Browse the repository at this point in the history
This changelist adds an empty vector check to node paste operations in the graph editor, addressing a case where copying nodes from a deleted material would trigger a crash.
  • Loading branch information
jstone-lucasfilm committed Aug 19, 2023
1 parent 7fd2b4f commit 42bb654
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions source/MaterialXGraphEditor/Graph.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3796,11 +3796,11 @@ void Graph::drawGraph(ImVec2 mousePos)
linkGraph();
ImVec2 canvasPos = ed::ScreenToCanvas(mousePos);
// place the copied nodes or the individual new nodes
if ((int) _copiedNodes.size() > 0)
if (!_copiedNodes.empty())
{
positionPasteBin(canvasPos);
}
else
else if (!_graphNodes.empty())
{
ed::SetNodePosition(_graphNodes.back()->getId(), canvasPos);
}
Expand Down

0 comments on commit 42bb654

Please sign in to comment.