fix(tauri-runtime-wry): Window::inner_size crash when the window has no webviews (#9428)

This commit is contained in:
Lucas Fernandes Nogueira 2024-04-15 08:28:59 -03:00 committed by GitHub
parent c8a82ad223
commit 02eaf07872
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 1 deletions

View File

@ -0,0 +1,5 @@
---
"tauri-runtime-wry": patch:bug
---
Fixes `inner_size` crash when the window has no webviews.

View File

@ -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()) };