diff --git a/src/graph/graph-component.cc b/src/graph/graph-component.cc
index 1bed00690e1d099d1dec580c0929a5ff1fc705aa..b9188b8fdd52cc8731a0b77f138d3fbf59330252 100644
--- a/src/graph/graph-component.cc
+++ b/src/graph/graph-component.cc
@@ -140,7 +140,10 @@ namespace hpp {
 
       void GraphComponent::throwIfNotInitialized () const
       {
-        if (!isInit_ || (graph_.lock() && !graph_.lock()->isInit_)) throw std::logic_error ("The graph should have been initialized first.");
+        if (!isInit_){
+          throw std::logic_error
+            ("The graph should have been initialized first.");
+        }
       }
 
       std::ostream& operator<< (std::ostream& os,