[gnome-todo] task-list-view: Only update empty state if there's a model



commit 111a0c75859461e3505c8d9ebd2f7adde52dff5b
Author: Georges Basile Stavracas Neto <georges stavracas gmail com>
Date:   Fri Apr 30 13:41:48 2021 -0300

    task-list-view: Only update empty state if there's a model
    
    Otherwise we simply cannot figure out what state the empty
    state widget should be.

 src/gui/gtd-task-list-view.c | 3 +++
 1 file changed, 3 insertions(+)
---
diff --git a/src/gui/gtd-task-list-view.c b/src/gui/gtd-task-list-view.c
index 221ba2bc..d48cf7f9 100644
--- a/src/gui/gtd-task-list-view.c
+++ b/src/gui/gtd-task-list-view.c
@@ -235,6 +235,9 @@ update_empty_state (GtdTaskListView *self)
 
   g_assert (GTD_IS_TASK_LIST_VIEW (self));
 
+  if (!priv->model)
+    return;
+
   is_empty = g_list_model_get_n_items (priv->model) == 0;
   gtd_empty_list_widget_set_is_empty (priv->empty_list_widget, is_empty);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]