diff --git a/lib/rust/debug-api/src/lib.rs b/lib/rust/debug-api/src/lib.rs index 6b12b308c700..ee6719fbeb8f 100644 --- a/lib/rust/debug-api/src/lib.rs +++ b/lib/rust/debug-api/src/lib.rs @@ -151,7 +151,11 @@ macro_rules! window_prop_getter { use wasm_bindgen::JsCast; let window = web_sys::window()?; let prop = $prop; - Some(js_sys::Reflect::get(&window, &prop.into()).ok()?.unchecked_into()) + let val = js_sys::Reflect::get(&window, &prop.into()).ok()?; + if val.is_undefined() { + return None; + } + Some(val.unchecked_into()) } }; }