Fixed error when losing connection and segfaulting on notify_remind()

This commit is contained in:
James Booth
2013-05-06 00:33:33 +01:00
parent 3d8d5214bb
commit 78ff58cf77
5 changed files with 20 additions and 6 deletions

View File

@@ -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