Merge pull request #7 from deepak1556/empty_handle_converter_patch
create empty handle for null value
This commit is contained in:
commit
6b7e73db92
1 changed files with 4 additions and 0 deletions
|
@ -48,6 +48,10 @@ struct Converter<mate::Handle<T> > {
|
||||||
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val,
|
||||||
mate::Handle<T>* out) {
|
mate::Handle<T>* out) {
|
||||||
T* object = NULL;
|
T* object = NULL;
|
||||||
|
if (val->IsNull() || val->IsUndefined()) {
|
||||||
|
*out = mate::Handle<T>();
|
||||||
|
return true;
|
||||||
|
}
|
||||||
if (!Converter<T*>::FromV8(isolate, val, &object)) {
|
if (!Converter<T*>::FromV8(isolate, val, &object)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue