create empty handle for null or undefined value

This commit is contained in:
deepak1556 2016-11-28 00:41:44 +05:30
parent b5e5de626c
commit 70092b493e

View file

@ -48,6 +48,10 @@ struct Converter<mate::Handle<T> > {
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
mate::Handle<T>* out) {
T* object = NULL;
if (val->IsNull() || val->IsUndefined()) {
*out = mate::Handle<T>();
return true;
}
if (!Converter<T*>::FromV8(isolate, val, &object)) {
return false;
}