i'm a doofus and failed to notice the message is being returned as an array

This commit is contained in:
DarthArgus
2016-04-24 18:36:16 +00:00
parent 5fc9a0e689
commit f25da4f7f2
@@ -231,11 +231,7 @@ void ClientConnection::validateClient(const std::string & id, const std::string
if (j.count("message"))
{
// fuuuu hack here - .get<cstd::string>() is returning an array and not a string, wtf?
errMsg = j["message"].dump();
errMsg.erase(std::remove(errMsg.begin(), errMsg.end(), '"'), errMsg.end());
errMsg.erase(std::remove(errMsg.begin(), errMsg.end(), ']'), errMsg.end());
errMsg.erase(std::remove(errMsg.begin(), errMsg.end(), '['), errMsg.end());
errMsg = j["message"][0].get<std::string>();
}
else
{