Fix crash in address completion when matching group name.
authorwwp <wwp@free.fr>
Thu, 30 Jul 2015 08:13:06 +0000 (10:13 +0200)
committerwwp <wwp@free.fr>
Thu, 30 Jul 2015 08:13:06 +0000 (10:13 +0200)
src/addr_compl.c

index c3ffefb..b3398f6 100644 (file)
@@ -231,7 +231,14 @@ static gint addr_comparison_func(gconstpointer a, gconstpointer b)
                return 1;
        else {
            cmp = strcmp(a_ref->name, b_ref->name);
-           return cmp ? cmp :  strcmp(a_ref->address, b_ref->address);
+               if (cmp)
+                   return cmp;
+               else {
+                       if (a_ref->address && b_ref->address)
+                               return strcmp(a_ref->address, b_ref->address);
+                       else
+                               return -1;
+               }
        }
 }