workspace: Sanitize pinned tab count before usage (#21417)
Fixes all sorts of panics around usage of incorrect pinned tab count that has been fixed in app itself, yet persists in user db. Closes #ISSUE Release Notes: - N/A
This commit is contained in:
@@ -1890,7 +1890,7 @@ impl Pane {
|
||||
fn unpin_tab_at(&mut self, ix: usize, cx: &mut ViewContext<'_, Self>) {
|
||||
maybe!({
|
||||
let pane = cx.view().clone();
|
||||
self.pinned_tab_count = self.pinned_tab_count.checked_sub(1).unwrap();
|
||||
self.pinned_tab_count = self.pinned_tab_count.checked_sub(1)?;
|
||||
let destination_index = self.pinned_tab_count;
|
||||
|
||||
let id = self.item_for_index(ix)?.item_id();
|
||||
|
||||
Reference in New Issue
Block a user