Index: components/json_schema/json_schema_validator.cc |
diff --git a/components/json_schema/json_schema_validator.cc b/components/json_schema/json_schema_validator.cc |
index 3816a7609708327294e8b61dcc1a1e214a0f1304..af5886a9b9cef189b8337778c6cace9c04eb211f 100644 |
--- a/components/json_schema/json_schema_validator.cc |
+++ b/components/json_schema/json_schema_validator.cc |
@@ -195,6 +195,13 @@ bool IsValidSchema(const base::DictionaryValue* dict, std::string* error) { |
for (size_t i = 0; i < list_value->GetSize(); ++i) { |
const base::Value* value = NULL; |
list_value->Get(i, &value); |
+ const base::DictionaryValue* value_dict; |
not at google - send to devlin
2013/10/28 18:00:25
= NULL
Sam McNally
2013/10/29 00:39:02
Done.
|
+ if (value->GetAsDictionary(&value_dict)) { |
+ if (!value_dict->Get("name", &value)) { |
+ *error = "Invalid value in enum attribute"; |
+ return false; |
+ } |
+ } |
switch (value->GetType()) { |
case base::Value::TYPE_NULL: |
case base::Value::TYPE_BOOLEAN: |
@@ -479,6 +486,12 @@ void JSONSchemaValidator::ValidateEnum(const base::Value* instance, |
for (size_t i = 0; i < choices->GetSize(); ++i) { |
const base::Value* choice = NULL; |
CHECK(choices->Get(i, &choice)); |
+ const base::DictionaryValue* choice_dict; |
+ if (choice->GetAsDictionary(&choice_dict)) { |
+ if (!choice_dict->Get("name", &choice)) { |
+ NOTREACHED(); |
+ } |
+ } |
not at google - send to devlin
2013/10/28 18:00:25
likewise
not at google - send to devlin
2013/10/29 16:25:16
(still applicable)
Sam McNally
2013/10/30 03:08:37
Done (before the switch for the same reason).
|
switch (choice->GetType()) { |
case base::Value::TYPE_NULL: |
case base::Value::TYPE_BOOLEAN: |