Fixed svace. (84670 - DEREF_OF_NULL.RET.PROC.STAT)
authorJongHeon Choi <j-h.choi@samsung.com>
Tue, 14 Jun 2016 07:12:42 +0000 (16:12 +0900)
committerJongHeon Choi <j-h.choi@samsung.com>
Tue, 14 Jun 2016 07:12:50 +0000 (16:12 +0900)
extensions/renderer/xwalk_module_system.cc

index 43d9630..b14f12c 100644 (file)
@@ -38,6 +38,7 @@ void RequireNativeCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
   if (module_system_value.IsEmpty() || module_system_value->IsUndefined()) {
     LOGGER(ERROR) << "Trying to use requireNative from already "
                   << "destroyed module system!";
+    result.SetUndefined();
     return;
   }
 
@@ -49,6 +50,10 @@ void RequireNativeCallback(const v8::FunctionCallbackInfo<v8::Value>& info) {
     result.SetUndefined();
     return;
   }
+  if (!module_system) {
+    result.SetUndefined();
+    return;
+  }
   v8::Handle<v8::Object> object =
       module_system->RequireNative(*v8::String::Utf8Value(info[0]));
   if (object.IsEmpty()) {