summaryrefslogtreecommitdiffstats
path: root/gin/modules
diff options
context:
space:
mode:
authorjochen <jochen@chromium.org>2015-07-13 01:21:34 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-13 08:22:08 +0000
commit87d2fee36df3923c78eeccb9d4c4719a542a4591 (patch)
tree4f299b73368bbd8c4cf439b628df8d05c0631344 /gin/modules
parent7fe582b92fb1fe9b5930b609d5f425912f66f023 (diff)
downloadchromium_src-87d2fee36df3923c78eeccb9d4c4719a542a4591.zip
chromium_src-87d2fee36df3923c78eeccb9d4c4719a542a4591.tar.gz
chromium_src-87d2fee36df3923c78eeccb9d4c4719a542a4591.tar.bz2
Check whether the handle returned by PeekNext() is empty before accessing it
BUG=507625 R=haraken@chromium.org Review URL: https://codereview.chromium.org/1232343004 Cr-Commit-Position: refs/heads/master@{#338480}
Diffstat (limited to 'gin/modules')
-rw-r--r--gin/modules/module_registry.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/gin/modules/module_registry.cc b/gin/modules/module_registry.cc
index 036e98d..b75894c 100644
--- a/gin/modules/module_registry.cc
+++ b/gin/modules/module_registry.cc
@@ -66,9 +66,9 @@ void Define(const v8::FunctionCallbackInfo<Value>& info) {
std::vector<std::string> dependencies;
v8::Local<Value> factory;
- if (args.PeekNext()->IsString())
+ if (!args.PeekNext().IsEmpty() && args.PeekNext()->IsString())
args.GetNext(&id);
- if (args.PeekNext()->IsArray())
+ if (!args.PeekNext().IsEmpty() && args.PeekNext()->IsArray())
args.GetNext(&dependencies);
if (!args.GetNext(&factory))
return args.ThrowError();