diff --git a/src/frame/frame_base.cpp b/src/frame/frame_base.cpp
index fd2edab072aa6478bea276a4b8fa1995eec68cf7..e0a7a9346db948819d49aa6202cc351f2432c24a 100644
--- a/src/frame/frame_base.cpp
+++ b/src/frame/frame_base.cpp
@@ -287,6 +287,7 @@ void FrameBase::link(TrajectoryBasePtr _trj_ptr)
 {
     assert(!is_removing_ && "linking a removed frame");
     assert(this->getTrajectory() == nullptr && "linking an already linked frame");
+    assert(isKey() && "Trying to link a non keyframe");
 
     if(_trj_ptr)
     {
diff --git a/test/gtest_has_state_blocks.cpp b/test/gtest_has_state_blocks.cpp
index 6b403ea31ca156613e8e17f03b922cb3bffa3e68..36c037f56c52527d56ab881df6b7381a5f555a79 100644
--- a/test/gtest_has_state_blocks.cpp
+++ b/test/gtest_has_state_blocks.cpp
@@ -55,7 +55,7 @@ TEST_F(HasStateBlocksTest, Notifications_setKey_add)
     Notification n;
     ASSERT_FALSE(problem->getStateBlockNotification(sbp0, n));
 
-    // F0->link(problem->getTrajectory());
+    ASSERT_DEATH(F0->link(problem->getTrajectory()), "Assertion `isKey()");
 
     // ASSERT_FALSE(problem->getStateBlockNotification(sbp0, n));