diff --git a/crates/napi/src/bindgen_runtime/js_values.rs b/crates/napi/src/bindgen_runtime/js_values.rs index 25ea9d98..3b8d175f 100644 --- a/crates/napi/src/bindgen_runtime/js_values.rs +++ b/crates/napi/src/bindgen_runtime/js_values.rs @@ -169,7 +169,7 @@ impl ValidateNapiValue for Option { )?; let received_type = ValueType::from(result); - if received_type == ValueType::Null { + if received_type == ValueType::Null || received_type == ValueType::Undefined { Ok(ptr::null_mut()) } else if let Ok(validate_ret) = unsafe { T::validate(env, napi_val) } { Ok(validate_ret)