Skip to content

Commit

Permalink
fix(tauri-runtime-wry): Window::inner_size crash when the window has …
Browse files Browse the repository at this point in the history
…no webviews (#9428)
  • Loading branch information
lucasfernog committed Apr 15, 2024
1 parent c8a82ad commit 02eaf07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions .changes/fix-window-inner-size-crash.md
@@ -0,0 +1,5 @@
---
"tauri-runtime-wry": patch:bug
---

Fixes `inner_size` crash when the window has no webviews.
2 changes: 1 addition & 1 deletion core/tauri-runtime-wry/src/lib.rs
Expand Up @@ -4082,7 +4082,7 @@ fn inner_size(
webviews: &[WebviewWrapper],
has_children: bool,
) -> TaoPhysicalSize<u32> {
if !has_children {
if !has_children && webviews.len() > 0 {
use wry::WebViewExtMacOS;
let webview = webviews.first().unwrap();
let view_frame = unsafe { cocoa::appkit::NSView::frame(webview.webview()) };
Expand Down

0 comments on commit 02eaf07

Please sign in to comment.