nodeview: null checks on select code

Prevents segfaults if the node view clears before the timeline.
This commit is contained in:
itsmattkc
2020-10-06 00:10:53 +11:00
parent 2d8c605cc9
commit 2ccbfa7715
+8
View File
@@ -200,6 +200,10 @@ void NodeView::SelectWithDependencies(QList<Node *> nodes)
void NodeView::SelectBlocks(const QList<Block *> &blocks)
{
if (!graph_) {
return;
}
selected_blocks_.append(blocks);
SelectBlocksInternal();
@@ -207,6 +211,10 @@ void NodeView::SelectBlocks(const QList<Block *> &blocks)
void NodeView::DeselectBlocks(const QList<Block *> &blocks)
{
if (!graph_) {
return;
}
// Remove temporary associations
foreach (Block* b, selected_blocks_) {
if (!blocks.contains(b)) {