From e1a21538a4fc8c139af505075635edbd98aaef75 Mon Sep 17 00:00:00 2001 From: Charles Lowell Date: Fri, 25 May 2012 12:58:32 -0500 Subject: [PATCH] Don't wrap an empty handle --- ext/v8/rr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/v8/rr.h b/ext/v8/rr.h index cf39c87..fac8c32 100644 --- a/ext/v8/rr.h +++ b/ext/v8/rr.h @@ -82,7 +82,7 @@ public: this->handle = handle; } virtual operator VALUE() const { - return (new Holder(handle, Class))->value; + return handle.IsEmpty() ? Qnil : (new Holder(handle, Class))->value; } virtual operator v8::Handle() const { if (RTEST(this->value)) {