mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
Merge pull request #7 from deepak1556/empty_handle_converter_patch
create empty handle for null value
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user