Fix crash when using v to select in an empty task list

This commit is contained in:
Dheepak Krishnamurthy 2021-07-19 13:29:19 -06:00
parent 96c3bb0b8c
commit 96a7dfbc4e

View file

@ -1993,6 +1993,7 @@ impl TaskwarriorTuiApp {
}
pub fn toggle_mark(&mut self) {
if !self.tasks.is_empty() {
let selected = self.current_selection;
let task_id = self.tasks[selected].id().unwrap_or_default();
let task_uuid = *self.tasks[selected].uuid();
@ -2001,6 +2002,7 @@ impl TaskwarriorTuiApp {
self.marked.remove(&task_uuid);
}
}
}
pub fn toggle_mark_all(&mut self) {
for task in &self.tasks {