Skip to content

Commit c488e39

Browse files
committed
Check napi callee status
1 parent e9880a1 commit c488e39

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/napi-inl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -2844,7 +2844,8 @@ inline void ArrayBuffer::Detach() {
28442844
inline size_t Buffer<T>::Length() const {
28452845
void *data = nullptr;
28462846
size_t length = 0;
2847-
napi_get_buffer_info(_env, _value, &data, &length);
2847+
napi_status status = napi_get_buffer_info(_env, _value, &data, &length);
2848+
NAPI_THROW_IF_FAILED(_env, status, Buffer<T>());
28482849
return length;
28492850
}
28502851

0 commit comments

Comments
 (0)