1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-07-30 16:24:09 +03:00

Libraries: fixed incorrect handling of null types

This commit is contained in:
Federico Fissore
2015-05-19 16:26:03 +02:00
parent f13fe9a4f7
commit 9191442aea
3 changed files with 14 additions and 62 deletions

View File

@ -16,6 +16,12 @@ public class LibraryByTypeComparator implements Comparator<ContributedLibrary> {
@Override
public int compare(ContributedLibrary o1, ContributedLibrary o2) {
if (o1.getTypes() == null) {
return 1;
}
if (o2.getTypes() == null) {
return -1;
}
return libraryTypeComparator.compare(o1.getTypes().get(0), o2.getTypes().get(0));
}

View File

@ -6,6 +6,12 @@ public class LibraryOfSameTypeComparator implements Comparator<ContributedLibrar
@Override
public int compare(ContributedLibrary o1, ContributedLibrary o2) {
if (o1.getTypes() == null) {
return 1;
}
if (o2.getTypes() == null) {
return -1;
}
if (!o1.getTypes().get(0).equals(o2.getTypes().get(0))) {
return 0;
}