nodejs/node-addon-api

How do I initialize a variable of type napi_value to NULL to avoid compiler warnings

sharadraju opened this issue · 4 comments

We use node-addon-api code for our Node.js driver (oracledb) for Oracle Database.

We are facing some compiler warnings for uninitialized napi_value type variable. Can I initialize a variable of type napi_value to NULL?

You should just be able to napi_value foo = nullptr; but nullptr is not a valid value (ie. it is not the same as JavaScript null) so do not pass this nullptr to Node-API functions.

Thanks @KevinEady. Let me try that

Closing due to inactivity. Let us know if you need more help.

Yes, we found the solution for this. Thanks @KevinEady for helping.