diff options
author | James Booth <boothj5@gmail.com> | 2013-05-06 00:33:33 +0100 |
---|---|---|
committer | James Booth <boothj5@gmail.com> | 2013-05-06 00:33:33 +0100 |
commit | 78ff58cf770b19b5f1eaf760d168799a8a6473e5 (patch) | |
tree | 620201ea5bc0db2a2f907d87e2c8f3976842fc7d /src/tools/autocomplete.c | |
parent | 3d8d5214bb93808252be6259980759ae3f3a2bbe (diff) | |
download | profani-tty-78ff58cf770b19b5f1eaf760d168799a8a6473e5.tar.gz |
Fixed error when losing connection and segfaulting on notify_remind()
Diffstat (limited to 'src/tools/autocomplete.c')
-rw-r--r-- | src/tools/autocomplete.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/tools/autocomplete.c b/src/tools/autocomplete.c index 72abcba4..adac86de 100644 --- a/src/tools/autocomplete.c +++ b/src/tools/autocomplete.c @@ -74,7 +74,13 @@ autocomplete_free(Autocomplete ac) gint autocomplete_length(Autocomplete ac) { - return g_slist_length(ac->items); + if (ac == NULL) { + return 0; + } else if (ac->items == NULL) { + return 0; + } else { + return g_slist_length(ac->items); + } } gboolean |