diff --git a/include/napi-inl.h b/include/napi-inl.h index 8240a80..4dc2e48 100644 --- a/include/napi-inl.h +++ b/include/napi-inl.h @@ -2844,7 +2844,8 @@ inline void ArrayBuffer::Detach() { inline size_t Buffer::Length() const { void *data = nullptr; size_t length = 0; - napi_get_buffer_info(_env, _value, &data, &length); + napi_status status = napi_get_buffer_info(_env, _value, &data, &length); + NAPI_THROW_IF_FAILED(_env, status, Buffer()); return length; }