Coverity complains:
CID 59386 (#1 of 1): Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking cons suggests that it may be null, but it has
already been dereferenced on all paths leading to the check.
int i;
NmcSortInfo compare_info;
+ if (!cons)
+ return;
+
compare_info.nmc = nmc;
compare_info.order = order;
sorted = g_ptr_array_sized_new (cons->len);
- for (i = 0; cons && i < cons->len; i++)
+ for (i = 0; i < cons->len; i++)
g_ptr_array_add (sorted, cons->pdata[i]);
g_ptr_array_sort_with_data (sorted, compare_connections, &compare_info);
return sorted;