From 3a65e2dd7f37684081ad8eb62fb64fbc418c4a47 Mon Sep 17 00:00:00 2001 From: Pave Pimenov Date: Sat, 12 Sep 2020 19:53:06 +0300 Subject: [PATCH] fix https://github.com/Tencent/rapidjson/issues/1778 (part 1) --- include/rapidjson/schema.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/include/rapidjson/schema.h b/include/rapidjson/schema.h index fc39d06..4e5f217 100644 --- a/include/rapidjson/schema.h +++ b/include/rapidjson/schema.h @@ -475,12 +475,12 @@ public: 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())) { + if (const ValueType* v = GetMember(value, GetNotString())) { schemaDocument->CreateSchema(¬_, p.Append(GetNotString(), allocator_), *v, document); notValidatorIndex_ = validatorCount_; validatorCount_++; + } } // Object @@ -915,7 +915,7 @@ public: } if (additionalPropertiesSchema_) { - if (additionalPropertiesSchema_ && context.patternPropertiesSchemaCount > 0) { + if (context.patternPropertiesSchemaCount > 0) { context.patternPropertiesSchemas[context.patternPropertiesSchemaCount++] = additionalPropertiesSchema_; context.valueSchema = typeless_; context.valuePatternValidatorType = Context::kPatternValidatorWithAdditionalProperty;