Make initialization options parsing less crashy if null is passed instead of undefined/nothing.

See issue #247.
This commit is contained in:
Jacob Dufault 2018-01-06 20:53:58 -08:00
parent a4496b7430
commit a0a52e50a2

View File

@ -40,6 +40,9 @@ class JsonReader : public Reader {
}
void DoMember(const char* name, std::function<void(Reader&)> fn) override {
if (m_->GetType() != rapidjson::Type::kObjectType)
return; // FIXME: signal an error that object was not deserialized correctly?
auto it = m_->FindMember(name);
if (it != m_->MemberEnd()) {
JsonReader sub(&it->value);