From 07b70cd4a1c90936e85be48d4178b4185b3437e8 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, 8 Apr 2024 11:38:40 -0600 Subject: [PATCH] tasks: fix panic in render_match (cherry-pick #10137) (#10288) Cherry-picked tasks: fix panic in render_match (#10137) Release Notes: - Fixed panic in tasks modal (Preview only). Co-authored-by: Piotr Osiewicz <24362066+osiewicz@users.noreply.github.com> --- crates/tasks_ui/src/modal.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/crates/tasks_ui/src/modal.rs b/crates/tasks_ui/src/modal.rs index 7964362f1ba90f79cd6410ce19c9303287282414..25f69fbe1a8f467173df9e42e9be41c231424f21 100644 --- a/crates/tasks_ui/src/modal.rs +++ b/crates/tasks_ui/src/modal.rs @@ -307,8 +307,8 @@ impl PickerDelegate for TasksModalDelegate { cx: &mut ViewContext>, ) -> Option { let candidates = self.candidates.as_ref()?; - let hit = &self.matches[ix]; - let (source_kind, _) = &candidates[hit.candidate_id]; + let hit = &self.matches.get(ix)?; + let (source_kind, _) = &candidates.get(hit.candidate_id)?; let details = match source_kind { TaskSourceKind::UserInput => "user input".to_string(), TaskSourceKind::Buffer => "language extension".to_string(),