diff --git a/MathLib/VectorizedTensor.h b/MathLib/VectorizedTensor.h
index 3a70bee3b0dc38a0ae225a081a57543b1532ad44..83f3ac2be722e80c49bfc1e824906847d45a1255 100644
--- a/MathLib/VectorizedTensor.h
+++ b/MathLib/VectorizedTensor.h
@@ -195,6 +195,8 @@ Type<DisplacementDim> toVector(Eigen::MatrixBase<Derived> const& tensor)
     {
         return tensor.reshaped();
     }
+    OGS_FATAL(
+        "Not all cases handled in the VectorizedTensor::toVector() function.");
 }
 
 /// Converts a vectorized tensor to a 3x3 matrix.