From 050558b18cdb88833a49a1999774e9d478476934 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Joan=20Sol=C3=A0?= <jsola@iri.upc.edu>
Date: Wed, 10 Jun 2020 14:29:26 +0200
Subject: [PATCH] Fis offending casse with an assert

---
 include/core/state_block/has_state_blocks.h | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/include/core/state_block/has_state_blocks.h b/include/core/state_block/has_state_blocks.h
index 9462efe7a..8880fc0a2 100644
--- a/include/core/state_block/has_state_blocks.h
+++ b/include/core/state_block/has_state_blocks.h
@@ -301,9 +301,9 @@ inline VectorXd HasStateBlocks::getStateVector(const StateStructure& _sub_struct
     for (const char key : structure)
     {
         const auto& sb = getStateBlock(key);
-        if (!sb){
-            WOLF_ERROR("Stateblock key ", key, " not in the structure");
-        }
+
+        assert(sb != nullptr && "Requested StateBlock key not in the structure");
+
         state.segment(index,sb->getSize()) = sb->getState();
         index += sb->getSize();
     }
-- 
GitLab