From cbe930af3abb2a10da503ec753b9e5d253754eab Mon Sep 17 00:00:00 2001
From: Olivier BICHLER <olivier.bichler@cea.fr>
Date: Thu, 13 Jun 2024 23:00:28 +0200
Subject: [PATCH] Fixed critical issue with Node::views()

---
 include/aidge/graph/Node.hpp | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/include/aidge/graph/Node.hpp b/include/aidge/graph/Node.hpp
index a00debad1..7e9cfe399 100644
--- a/include/aidge/graph/Node.hpp
+++ b/include/aidge/graph/Node.hpp
@@ -252,7 +252,9 @@ public:
   inline std::set<std::shared_ptr<GraphView>> views() const noexcept {
     std::set<std::shared_ptr<GraphView>> res;
     for (const auto &v : mViews) {
-      res.insert(v.lock());
+      if (auto p = v.lock()) {
+        res.insert(p);
+      }
     }
     return res;
   }
-- 
GitLab