diff --git a/src/e_mod_places.c b/src/e_mod_places.c index b22935a..ce60a78 100644 --- a/src/e_mod_places.c +++ b/src/e_mod_places.c @@ -184,6 +184,9 @@ _places_volume_sort_cb(const void *d1, const void *d2) const Volume *v1 = d1; const Volume *v2 = d2; + if(!v1) return(1); + if(!v2) return(-1); + // removable after interal if (v1->removable && !v2->removable) return(1); if (v2->removable && !v1->removable) return(-1); @@ -191,8 +194,8 @@ _places_volume_sort_cb(const void *d1, const void *d2) if (v1->mount_point && !strcmp(v1->mount_point, "/")) return -1; if (v2->mount_point && !strcmp(v2->mount_point, "/")) return 1; // order by label - if(!v1 || !v1->label) return(1); - if(!v2 || !v2->label) return(-1); + if(!v1->label) return(1); + if(!v2->label) return(-1); return strcmp(v1->label, v2->label); }