From 3157cd45695a4089c0c42dd8675c978c0560964f Mon Sep 17 00:00:00 2001 From: Ricky Kresslein Date: Mon, 5 Feb 2024 11:08:59 +0100 Subject: Fix bug causing app to crash when restarting a completed Pomodoro task --- src/ui/window.rs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'src') diff --git a/src/ui/window.rs b/src/ui/window.rs index 8591038..01d3052 100644 --- a/src/ui/window.rs +++ b/src/ui/window.rs @@ -225,9 +225,11 @@ impl FurtheranceWindow { if settings_manager::get_bool("autocomplete") { if task_input.text().len() >= FurtheranceWindow::MIN_PREFIX_LENGTH.try_into().unwrap() { - let task_autocomplete = task_input.completion().unwrap(); - let model = Self::update_list_model(task_name.to_string(), split_tags).unwrap(); - task_autocomplete.set_model(Some(&model)); + if task_input.completion().is_some() { + let task_autocomplete = task_input.completion().unwrap(); + let model = Self::update_list_model(task_name.to_string(), split_tags).unwrap(); + task_autocomplete.set_model(Some(&model)); + } } } })); -- cgit 1.4.1