From 70092b493e9d17dfc8009c6b60ba35332bee8507 Mon Sep 17 00:00:00 2001 From: deepak1556 Date: Mon, 28 Nov 2016 00:41:44 +0530 Subject: [PATCH] create empty handle for null or undefined value --- native_mate/handle.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/native_mate/handle.h b/native_mate/handle.h index c5855f2f99be..60bd2348dd6c 100644 --- a/native_mate/handle.h +++ b/native_mate/handle.h @@ -48,6 +48,10 @@ struct Converter > { static bool FromV8(v8::Isolate* isolate, v8::Local val, mate::Handle* out) { T* object = NULL; + if (val->IsNull() || val->IsUndefined()) { + *out = mate::Handle(); + return true; + } if (!Converter::FromV8(isolate, val, &object)) { return false; }