Added handling of null

This commit is contained in:
Robert Osfield 2016-07-06 20:23:34 +01:00
parent 8b3944f51c
commit e5e89a3ac9

View File

@ -62,7 +62,7 @@ unsigned int JSONObject::getUniqueID() const
return 0xffffffff;
}
const JSONValue<unsigned int>* uid = dynamic_cast<JSONValue<unsigned int>*>(iterator->second.get());
return uid->getValue();
return uid ? uid->getValue() : 0xffffffff;
}
void JSONObject::addChild(const std::string& type, JSONObject* child)