diff options
Diffstat (limited to 'gin/modules')
-rw-r--r-- | gin/modules/module_registry.cc | 4 |
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(); |