about summary refs log tree commit diff
diff options
context:
space:
mode:
authorRicky Kresslein <ricky@unobserved.io>2024-02-05 11:08:59 +0100
committerRicky Kresslein <ricky@unobserved.io>2024-02-05 11:08:59 +0100
commit3157cd45695a4089c0c42dd8675c978c0560964f (patch)
treed06070c35e1ca8cfa636cc01756c0a7f5ba5a40a
parent854466bb77ca187d131c9e67f9f8f530b6e42302 (diff)
downloadFurtherance-3157cd45695a4089c0c42dd8675c978c0560964f.tar.zst
Fix bug causing app to crash when restarting a completed Pomodoro task
-rw-r--r--Cargo.lock2
-rw-r--r--src/ui/window.rs8
2 files changed, 6 insertions, 4 deletions
diff --git a/Cargo.lock b/Cargo.lock
index 07a52cf..71a55e6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -278,7 +278,7 @@ dependencies = [
 
 [[package]]
 name = "furtherance"
-version = "1.8.1"
+version = "1.8.2"
 dependencies = [
  "anyhow",
  "chrono",
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));
+                        }
                     }
                 }
             }));