From a5f3b2e78cbb9a7456296523377bd602ed0f8a4e Mon Sep 17 00:00:00 2001 From: jkomyno Date: Wed, 31 Jan 2024 15:50:58 +0100 Subject: [PATCH] fix(napi): in "Object::get", return null values wrapped in a "Some" --- crates/napi/src/bindgen_runtime/js_values/object.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/napi/src/bindgen_runtime/js_values/object.rs b/crates/napi/src/bindgen_runtime/js_values/object.rs index 50d3b11d..027a8b26 100644 --- a/crates/napi/src/bindgen_runtime/js_values/object.rs +++ b/crates/napi/src/bindgen_runtime/js_values/object.rs @@ -35,7 +35,7 @@ impl Object { let ty = type_of!(self.0.env, ret)?; - Ok(if ty == ValueType::Undefined || ty == ValueType::Null { + Ok(if ty == ValueType::Undefined { None } else { Some(V::from_napi_value(self.0.env, ret)?)