diff --git a/include/aidge/graph/Node.hpp b/include/aidge/graph/Node.hpp index a00debad1b2efe4c9577f6e1a2e730d7011907e5..7e9cfe399a1e13f281c999fafcf7d823276b7670 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; }