diff --git a/src/json.hpp b/src/json.hpp
index 5fdd83d6..d7af3a70 100644
--- a/src/json.hpp
+++ b/src/json.hpp
@@ -3036,10 +3036,8 @@ class basic_json
         {
             return m_value.boolean;
         }
-        else
-        {
-            JSON_THROW(std::domain_error("type must be boolean, but is " + type_name()));
-        }
+
+        JSON_THROW(std::domain_error("type must be boolean, but is " + type_name()));
     }
 
     /// get a pointer to the value (object)
diff --git a/src/json.hpp.re2c b/src/json.hpp.re2c
index 068b8763..cc11457f 100644
--- a/src/json.hpp.re2c
+++ b/src/json.hpp.re2c
@@ -3036,10 +3036,8 @@ class basic_json
         {
             return m_value.boolean;
         }
-        else
-        {
-            JSON_THROW(std::domain_error("type must be boolean, but is " + type_name()));
-        }
+
+        JSON_THROW(std::domain_error("type must be boolean, but is " + type_name()));
     }
 
     /// get a pointer to the value (object)