Fix crash when closing last zed window (#8102)

Fixes: #8100

Release Notes:

- N/A
This commit is contained in:
Joseph T. Lyons 2024-02-21 00:48:42 -05:00 committed by GitHub
parent c58d72ea2b
commit 92b2e5608b
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1243,7 +1243,7 @@ impl Context for AppContext {
.get_mut(handle.id) .get_mut(handle.id)
.ok_or_else(|| anyhow!("window not found"))? .ok_or_else(|| anyhow!("window not found"))?
.take() .take()
.unwrap(); .ok_or_else(|| anyhow!("window not found"))?;
let root_view = window.root_view.clone().unwrap(); let root_view = window.root_view.clone().unwrap();
let result = update(root_view, &mut WindowContext::new(cx, &mut window)); let result = update(root_view, &mut WindowContext::new(cx, &mut window));