diff --git a/include/core/utils/converter.h b/include/core/utils/converter.h index 8388f29939505f2d2d20e6c26ab828c9e3b3d7b0..76e710f75d4aeb31589e27aa819304ec0b8d9cec 100644 --- a/include/core/utils/converter.h +++ b/include/core/utils/converter.h @@ -97,6 +97,8 @@ template<> struct converter<char>{ static char convert(std::string val){ //Here we should check that val.length() == 1 and get val[0] into a char variable + if(val.length() == 1) return val.at(0); + else throw std::runtime_error("Invalid converstion to char. String too long. String provided: " + val); throw std::runtime_error("Invalid char conversion. String provided: " + val); } };