From 0da4f0a86e4bbb4bee60ca140c0a3d0921345f1c Mon Sep 17 00:00:00 2001
From: Olivier BICHLER <olivier.bichler@cea.fr>
Date: Tue, 10 Dec 2024 17:44:34 +0100
Subject: [PATCH] Hotfix for #214

---
 src/operator/MetaOperator.cpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/src/operator/MetaOperator.cpp b/src/operator/MetaOperator.cpp
index cd307c9d1..ae3c3ed6c 100644
--- a/src/operator/MetaOperator.cpp
+++ b/src/operator/MetaOperator.cpp
@@ -96,7 +96,9 @@ void Aidge::MetaOperator_Op::setBackend(const std::string &name, Aidge::DeviceId
         for(auto i: mGraph->inputNodes()){
             auto op_i = std::static_pointer_cast<OperatorTensor>(i->getOperator());
             for(std::size_t in_idx=0; in_idx < op_i->nbInputs(); ++in_idx){
-                op_i->getInput(in_idx)->setBackend(name, device);
+                if (op_i->getInput(in_idx)) {
+                    op_i->getInput(in_idx)->setBackend(name, device);
+                }
             }
         }
         for(auto o: mGraph->outputNodes()){
-- 
GitLab