Skip to content

Commit b11db87

Browse files
committed
Check napi callee status
1 parent 8cf4941 commit b11db87

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

.gitignore

+1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
build/
22
.idea/
3+
.vscode
34

45
cmake-build-debug/
56

include/napi-inl.h

+2-1
Original file line numberDiff line numberDiff line change
@@ -2853,7 +2853,8 @@ inline void ArrayBuffer::Detach() {
28532853
inline T* Buffer<T>::Data() const {
28542854
void *data = nullptr;
28552855
size_t length = 0;
2856-
napi_get_buffer_info(_env, _value, &data, &length);
2856+
napi_status status = napi_get_buffer_info(_env, _value, &data, &length);
2857+
NAPI_THROW_IF_FAILED(_env, status, Buffer<T>());
28572858
return reinterpret_cast<T*>(data);
28582859
}
28592860

0 commit comments

Comments
 (0)