diff --git a/src/ros_tf_listener.hh b/src/ros_tf_listener.hh
index d09433e4e53ca6789e50fb780798fc82104d60b8..3c072513e9cc8f1ca894d5db59629249bf10f939 100644
--- a/src/ros_tf_listener.hh
+++ b/src/ros_tf_listener.hh
@@ -43,6 +43,7 @@ namespace dynamicgraph {
         } catch (const tf::TransformException& ex) {
           res.setIdentity();
           ROS_ERROR("Enable to get transform at time %i: %s",time,ex.what());
+          return res;
         }
         for (sot::MatrixHomogeneous::Index r = 0; r < 3; ++r) {
           for (sot::MatrixHomogeneous::Index c = 0; c < 3; ++c)