Skip to content

Commit

Permalink
Check napi callee status
Browse files Browse the repository at this point in the history
  • Loading branch information
richerfu committed Dec 1, 2024
1 parent 8cf4941 commit b11db87
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
build/
.idea/
.vscode

cmake-build-debug/

Expand Down
3 changes: 2 additions & 1 deletion include/napi-inl.h
Original file line number Diff line number Diff line change
Expand Up @@ -2853,7 +2853,8 @@ inline void ArrayBuffer::Detach() {
inline T* Buffer<T>::Data() 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<T>());
return reinterpret_cast<T*>(data);
}

Expand Down

0 comments on commit b11db87

Please sign in to comment.