diff --git a/src/serializers/json.h b/src/serializers/json.h index b6e5b005..6707322a 100644 --- a/src/serializers/json.h +++ b/src/serializers/json.h @@ -40,6 +40,9 @@ class JsonReader : public Reader { } void DoMember(const char* name, std::function 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);