Skip to content
Snippets Groups Projects
Commit db01f456 authored by Thibault Allenet's avatar Thibault Allenet
Browse files

Add execption in replaceWith for non existing input nodes

parent 1520242d
No related branches found
No related tags found
No related merge requests found
......@@ -575,13 +575,14 @@ bool Aidge::GraphView::replaceWith(std::set<std::shared_ptr<Node>> newNodes) {
for (auto& nodePtr : copyNode) { nodePtr->resetConnections(true); }
// copy output connections
for (IONb_t o = 0; o < previousOutputNode->nbOutputs(); ++o) {
auto outputPairs = copyOutputs[o];
for (const auto& onePair : outputPairs) {
newOutputNode->addChild(onePair.first, o, onePair.second);
if (newOutputNode) {
for (IONb_t o = 0; o < previousOutputNode->nbOutputs(); ++o) {
auto outputPairs = copyOutputs[o];
for (const auto& onePair : outputPairs) {
newOutputNode->addChild(onePair.first, o, onePair.second);
}
}
}
// insert new Nodes in the right GraphViews
for (auto& graphPtr : commonGraphViews) {
graphPtr->add(newNodes, false);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment