Skip to content

Commit 35022fa

Browse files
authored
fix(macos): don't panic if Request can't be constructed (#1554)
1 parent 60dba38 commit 35022fa

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/wkwebview/class/wry_web_view_delegate.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,12 @@ define_class!(
5858
CStr::from_ptr(url_utf8).to_str(),
5959
CStr::from_ptr(js_utf8).to_str(),
6060
) {
61-
ipc_handler(Request::builder().uri(url).body(js.to_string()).unwrap());
61+
if let Ok(r) = Request::builder().uri(url).body(js.to_string()) {
62+
ipc_handler(r);
63+
} else {
64+
#[cfg(feature = "tracing")]
65+
tracing::warn!("WebView received invalid IPC request: {}", js);
66+
}
6267
return;
6368
}
6469
}

0 commit comments

Comments
 (0)