From 6984c9b459374033d68271678155de6ccb1485fc Mon Sep 17 00:00:00 2001 From: "zed-zippy[bot]" <234243425+zed-zippy[bot]@users.noreply.github.com> Date: Fri, 7 Nov 2025 13:22:52 +0000 Subject: [PATCH] workspace: Do not panic when the database is corruped (#42186) (cherry-pick to preview) (#42189) Cherry-pick of #42186 to preview ---- Fixes ZED-1NK Release Notes: - Fixed zed not starting when the database cannot be loaded Co-authored-by: Lukas Wirth --- crates/workspace/src/persistence.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/workspace/src/persistence.rs b/crates/workspace/src/persistence.rs index 1ed3d3673a7c7fef0937649693a93d4de37ca461..3d7ddf5d2ceae40f19e4684b63f6b33c8b53b280 100644 --- a/crates/workspace/src/persistence.rs +++ b/crates/workspace/src/persistence.rs @@ -791,12 +791,11 @@ impl WorkspaceDb { remote_connection_id IS ? LIMIT 1 }) - .map(|mut prepared_statement| { + .and_then(|mut prepared_statement| { (prepared_statement)(( root_paths.serialize().paths, remote_connection_id.map(|id| id.0 as i32), )) - .unwrap() }) .context("No workspaces found") .warn_on_err()