mirror of
https://github.com/Drop-OSS/wry-cef.git
synced 2026-01-30 20:55:24 +01:00
fix(macos): don't panic if Request can't be constructed (#1554)
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user