about summary refs log tree commit diff stats
path: root/src/tools/autocomplete.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/tools/autocomplete.c')
-rw-r--r--src/tools/autocomplete.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c
index 3361c10b..efff6ee0 100644
--- a/src/tools/autocomplete.c
+++ b/src/tools/autocomplete.c
@@ -62,10 +62,12 @@ autocomplete_new(void)
 void
 autocomplete_clear(Autocomplete ac)
 {
-    g_slist_free_full(ac->items, free);
-    ac->items = NULL;
+    if (ac != NULL) {
+        g_slist_free_full(ac->items, free);
+        ac->items = NULL;
 
-    autocomplete_reset(ac);
+        autocomplete_reset(ac);
+    }
 }
 
 void
@@ -335,4 +337,4 @@ _search_from(Autocomplete ac, GSList *curr, gboolean quote)
     }
 
     return NULL;
-}
\ No newline at end of file
+}