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)) {