Commit 08d65552 authored by Dmitry Kazakov's avatar Dmitry Kazakov

Change asserts into normal checks

Sometimes (during merge/grouping/ungrouping) it happens that active node
is changed by the model. The model knows only about a dummy, but not about
the node itself. And the node might have already become disconnected, even
though the dummy is still present.

BUG:395751
parent a83ef86d
......@@ -622,11 +622,13 @@ void KisNodeManager::slotSomethingActivatedNodeImpl(KisNodeSP node)
void KisNodeManager::slotNonUiActivatedNode(KisNodeSP node)
{
if (node == activeNode()) return;
// the node must still be in the graph, some asynchronous
// signals may easily break this requirement
KIS_SAFE_ASSERT_RECOVER_RETURN(!node || node->graphListener());
if (node && !node->graphListener()) {
node = 0;
}
if (node == activeNode()) return;
slotSomethingActivatedNodeImpl(node);
......@@ -640,11 +642,13 @@ void KisNodeManager::slotNonUiActivatedNode(KisNodeSP node)
void KisNodeManager::slotUiActivatedNode(KisNodeSP node)
{
if (node == activeNode()) return;
// the node must still be in the graph, some asynchronous
// signals may easily break this requirement
KIS_SAFE_ASSERT_RECOVER_RETURN(!node || node->graphListener());
if (node && !node->graphListener()) {
node = 0;
}
if (node == activeNode()) return;
slotSomethingActivatedNodeImpl(node);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment