From bb99ccb0309bb1cd5b3650af8ee6336325813040 Mon Sep 17 00:00:00 2001 From: piotr-kaminski-intel <32583365+piotr-kaminski-intel@users.noreply.github.com> Date: Tue, 10 Oct 2017 14:09:23 +0200 Subject: [PATCH] Init variable in the constructor line 358: 'this->notValidatorIndex_' might not be initialized in this constructor. --- include/rapidjson/schema.h | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index 2c5def1..cbcb550 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -410,9 +410,11 @@ public: } } - AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); - AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); - AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); + if (schemaDocument) { + AssignIfExist(allOf_, *schemaDocument, p, value, GetAllOfString(), document); + AssignIfExist(anyOf_, *schemaDocument, p, value, GetAnyOfString(), document); + AssignIfExist(oneOf_, *schemaDocument, p, value, GetOneOfString(), document); + } if (const ValueType* v = GetMember(value, GetNotString())) { schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document);