mirror of
https://bitbucket.org/theswgsource/src-1.2.git
synced 2026-07-14 00:01:30 -04:00
getString: check if null before casting
This commit is contained in:
+1
-1
@@ -52,7 +52,7 @@ bool webAPI::setData(std::string &data)
|
||||
|
||||
std::string webAPI::getString(const std::string &slot)
|
||||
{
|
||||
if (!this->responseData.empty() && !slot.empty() && responseData.count(slot))
|
||||
if (!this->responseData.empty() && !slot.empty() && responseData.count(slot) && !this->responseData[slot].is_null())
|
||||
{
|
||||
return this->responseData[slot].get<std::string>();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user