]> khamidou — GitHub mirrors - electron.git/commitdiff
Fix converting empty V8 dictionary.
authorCheng Zhao <zcbenz@gmail.com>
Mon, 23 Jun 2014 13:50:28 +0000 (21:50 +0800)
committerCheng Zhao <zcbenz@gmail.com>
Mon, 23 Jun 2014 13:50:28 +0000 (21:50 +0800)
atom/common/native_mate_converters/value_converter.cc

index 626917d620549a6ef9e39935f503b8f9b4ef39a0..79848b28bf44af159bd51070f1bd9f8367990834 100644 (file)
@@ -15,7 +15,7 @@ bool Converter<base::DictionaryValue>::FromV8(v8::Isolate* isolate,
   scoped_ptr<atom::V8ValueConverter> converter(new atom::V8ValueConverter);
   scoped_ptr<base::Value> value(converter->FromV8Value(
       val, v8::Context::GetCurrent()));
-  if (value->IsType(base::Value::TYPE_DICTIONARY)) {
+  if (value && value->IsType(base::Value::TYPE_DICTIONARY)) {
     out->Swap(static_cast<DictionaryValue*>(value.get()));
     return true;
   } else {