From 9d5e5d8ff2fc511c61f01da2ec9b57ab08fc6cf9 Mon Sep 17 00:00:00 2001
From: jcasals <jcasals@iri.upc.edu>
Date: Mon, 15 Jun 2020 17:46:30 +0200
Subject: [PATCH] Add char type to converter.h (Now for real (untested))

---
 include/core/utils/converter.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/include/core/utils/converter.h b/include/core/utils/converter.h
index 8388f2993..76e710f75 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);
     }
 };
-- 
GitLab