Skip to content

Commit 02eaf07

Browse files
authored
fix(tauri-runtime-wry): Window::inner_size crash when the window has no webviews (#9428)
1 parent c8a82ad commit 02eaf07

2 files changed

Lines changed: 6 additions & 1 deletion

File tree

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"tauri-runtime-wry": patch:bug
3+
---
4+
5+
Fixes `inner_size` crash when the window has no webviews.

core/tauri-runtime-wry/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4082,7 +4082,7 @@ fn inner_size(
40824082
webviews: &[WebviewWrapper],
40834083
has_children: bool,
40844084
) -> TaoPhysicalSize<u32> {
4085-
if !has_children {
4085+
if !has_children && webviews.len() > 0 {
40864086
use wry::WebViewExtMacOS;
40874087
let webview = webviews.first().unwrap();
40884088
let view_frame = unsafe { cocoa::appkit::NSView::frame(webview.webview()) };

0 commit comments

Comments
 (0)