summaryrefslogtreecommitdiff
path: root/cli/napi/env.rs
diff options
context:
space:
mode:
authorBartek IwaƄczuk <biwanczuk@gmail.com>2023-01-15 04:36:55 +0100
committerGitHub <noreply@github.com>2023-01-15 09:06:55 +0530
commitdf8bfa26be69af46b8f166e255330b5ba8d48893 (patch)
treee6aa1dec47e82d5cf2b3b01583a2c7fcb099e741 /cli/napi/env.rs
parente4c6e6e95f626b1ce8601f48344a76045f2d6479 (diff)
fix(napi): functions related to errors (#17370)
This commits fixes various NAPI functions related to creation and throwing of errors.
Diffstat (limited to 'cli/napi/env.rs')
-rw-r--r--cli/napi/env.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/cli/napi/env.rs b/cli/napi/env.rs
index 558b9b012..922c64140 100644
--- a/cli/napi/env.rs
+++ b/cli/napi/env.rs
@@ -158,8 +158,8 @@ fn napi_get_node_version(
env: *mut Env,
result: *mut *const napi_node_version,
) -> Result {
- let _: &mut Env = env.as_mut().ok_or(Error::InvalidArg)?;
- crate::check_arg!(result);
+ crate::check_env!(env);
+ crate::check_arg!(env, result);
*result = &NODE_VERSION as *const napi_node_version;
Ok(())