Ignore invalid JSON object when converting NSDictionary
This commit is contained in:
parent
97250b53e8
commit
240c346d02
1 changed files with 1 additions and 1 deletions
|
@ -26,7 +26,7 @@ NSDictionary* DictionaryValueToNSDictionary(const base::DictionaryValue& value)
|
|||
|
||||
scoped_ptr<base::DictionaryValue> NSDictionaryToDictionaryValue(
|
||||
NSDictionary* dict) {
|
||||
if (!dict)
|
||||
if (!dict || ![NSJSONSerialization isValidJSONObject:dict])
|
||||
return nullptr;
|
||||
|
||||
NSData* data = [NSJSONSerialization dataWithJSONObject:dict
|
||||
|
|
Loading…
Reference in a new issue