Fix crash when closing last zed window (#8102)

Joseph T. Lyons created

Fixes: #8100

Release Notes:

- N/A

Change summary

crates/gpui/src/app.rs | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

Detailed changes

crates/gpui/src/app.rs 🔗

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