Check for null when converting Wrappable
This commit is contained in:
parent
cad1fa50a9
commit
cc4e2fcd94
1 changed files with 4 additions and 1 deletions
|
@ -89,7 +89,10 @@ template<typename T>
|
||||||
struct Converter<T*, typename enable_if<
|
struct Converter<T*, typename enable_if<
|
||||||
is_convertible<T*, Wrappable*>::value>::type> {
|
is_convertible<T*, Wrappable*>::value>::type> {
|
||||||
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, T* val) {
|
static v8::Local<v8::Value> ToV8(v8::Isolate* isolate, T* val) {
|
||||||
return val->GetWrapper(isolate);
|
if (val)
|
||||||
|
return val->GetWrapper(isolate);
|
||||||
|
else
|
||||||
|
return v8::Null(isolate);
|
||||||
}
|
}
|
||||||
|
|
||||||
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val, T** out) {
|
static bool FromV8(v8::Isolate* isolate, v8::Local<v8::Value> val, T** out) {
|
||||||
|
|
Loading…
Reference in a new issue