diff --git a/native_mate/wrappable.cc b/native_mate/wrappable.cc index d783306c45be..fb051a8bbfa6 100644 --- a/native_mate/wrappable.cc +++ b/native_mate/wrappable.cc @@ -67,6 +67,8 @@ void* FromV8Impl(v8::Isolate* isolate, v8::Handle val) { if (!val->IsObject()) return NULL; v8::Handle obj = v8::Handle::Cast(val); + if (obj->InternalFieldCount() != 1) + return NULL; return MATE_GET_INTERNAL_FIELD_POINTER(obj, 0); }