From e6800bcc52fea5c5af281c527ba896550f6e5f1b 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:26 -0600 Subject: [PATCH] Don't panic on missing mtime (cherry-pick #9513) (#9514) 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 46c2ccd2a466dcb0a408f3ae7744f1171716b3eb..0dc224040496d7b2728d0fe81a8e39cd09b7cbef 100644 --- a/crates/project/src/project.rs +++ b/crates/project/src/project.rs @@ -7890,10 +7890,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)); }