From 43f00b239d6ca283f02793fa4049ef7974237895 Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Mon, 18 Mar 2024 14:37:20 -0600 Subject: [PATCH] Don't panic on missing mtime (cherry-pick #9513) (#9515) Cherry-picked Don't panic on missing mtime (#9513) This is expected as of zed 0.128 when a new unsaved file is created Release Notes: - Fixed a panic when collaborating with newer zed versions Co-authored-by: Conrad Irwin --- crates/project/src/project.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/crates/project/src/project.rs b/crates/project/src/project.rs index 1cfd4ee8d535ed54e53eb5287686f4aa2026f0ca..5bd18688fb37ff6b972de823cafd5926f235f469 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -7796,10 +7796,13 @@ impl Project { } let buffer_id = BufferId::new(state.id)?; - let buffer = cx.new_model(|_| { - Buffer::from_proto(this.replica_id(), this.capability(), state, buffer_file) - .unwrap() - }); + let buffer = Buffer::from_proto( + this.replica_id(), + this.capability(), + state, + buffer_file, + )?; + let buffer = cx.new_model(|_| buffer); this.incomplete_remote_buffers .insert(buffer_id, Some(buffer)); }