From 240c346d0205ef54bdda803804b62f364147bba5 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 18 May 2016 14:50:12 +0900 Subject: [PATCH] Ignore invalid JSON object when converting NSDictionary --- atom/browser/mac/dict_util.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/atom/browser/mac/dict_util.mm b/atom/browser/mac/dict_util.mm index 04837ebbae50..188909548eb3 100644 --- a/atom/browser/mac/dict_util.mm +++ b/atom/browser/mac/dict_util.mm @@ -26,7 +26,7 @@ NSDictionary* DictionaryValueToNSDictionary(const base::DictionaryValue& value) scoped_ptr NSDictionaryToDictionaryValue( NSDictionary* dict) { - if (!dict) + if (!dict || ![NSJSONSerialization isValidJSONObject:dict]) return nullptr; NSData* data = [NSJSONSerialization dataWithJSONObject:dict