File: crates/web/src/app.rs:925
Severity: robustness
Obvious? no
Inside the click handler that requests getUserMedia, web_sys::window().unwrap() panics if invoked from a non-window context (e.g. a worker harness during testing). The surrounding code path uses graceful let Ok(...) = ... for media_devices and get_user_media_with_constraints, so the unwrap() here is inconsistent with the established style.
Fix: convert to let Some(window) = web_sys::window() else { tracing::error!(...); return; } consistent with the surrounding gracefulness.
Filed by /general-audit @ b901575 (2026-05-02). master: #513.
File:
crates/web/src/app.rs:925Severity: robustness
Obvious? no
Inside the click handler that requests
getUserMedia,web_sys::window().unwrap()panics if invoked from a non-window context (e.g. a worker harness during testing). The surrounding code path uses gracefullet Ok(...) = ...formedia_devicesandget_user_media_with_constraints, so theunwrap()here is inconsistent with the established style.Fix: convert to
let Some(window) = web_sys::window() else { tracing::error!(...); return; }consistent with the surrounding gracefulness.Filed by
/general-audit@b901575(2026-05-02). master: #513.