From cc4e2fcd94b5a22e6720f0fba1c586a89640f1f6 Mon Sep 17 00:00:00 2001 From: Cheng Zhao Date: Wed, 24 Jun 2015 16:35:37 +0800 Subject: [PATCH] Check for null when converting Wrappable --- native_mate/wrappable.h | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/native_mate/wrappable.h b/native_mate/wrappable.h index c827a859c85..6f027f2e417 100644 --- a/native_mate/wrappable.h +++ b/native_mate/wrappable.h @@ -89,7 +89,10 @@ template struct Converter::value>::type> { static v8::Local 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 val, T** out) {