fix(macos): don't panic if Request can't be constructed (#1554)

This commit is contained in:
Oleh Dolhov
2025-07-02 12:53:12 +02:00
committed by GitHub
parent 60dba38ddc
commit 35022fa9bb

View File

@@ -58,7 +58,12 @@ define_class!(
CStr::from_ptr(url_utf8).to_str(),
CStr::from_ptr(js_utf8).to_str(),
) {
ipc_handler(Request::builder().uri(url).body(js.to_string()).unwrap());
if let Ok(r) = Request::builder().uri(url).body(js.to_string()) {
ipc_handler(r);
} else {
#[cfg(feature = "tracing")]
tracing::warn!("WebView received invalid IPC request: {}", js);
}
return;
}
}