Fix JS_GetArrayElement to not return an empty handle on success
authorJochen Eisinger <jochen@chromium.org>
Thu, 10 Sep 2015 11:44:04 +0000 (13:44 +0200)
committerJochen Eisinger <jochen@chromium.org>
Thu, 10 Sep 2015 11:44:04 +0000 (13:44 +0200)
BUG=chromium:528376
R=ulan@chromium.org, tsepez@chromium.org

Review URL: https://codereview.chromium.org/1337433002 .

fpdfsdk/src/jsapi/fxjs_v8.cpp

index f2f2e55..1dd479a 100644 (file)
@@ -743,7 +743,7 @@ v8::Local<v8::Value> JS_GetArrayElement(IJS_Runtime* pJSRuntime,
   if (pArray.IsEmpty())
     return v8::Local<v8::Value>();
   v8::Local<v8::Value> val;
-  if (pArray->Get(pJSRuntime->GetCurrentContext(), index).ToLocal(&val))
+  if (!pArray->Get(pJSRuntime->GetCurrentContext(), index).ToLocal(&val))
     return v8::Local<v8::Value>();
   return val;
 }