Merge pull request #505 from nextcloud/fixTimSort

try to fix TimSort, but it was just a plain NPE...
This commit is contained in:
Andy Scherzinger 2017-01-04 20:43:11 +01:00 committed by GitHub
commit 0ede6c9127

View file

@ -94,8 +94,14 @@ public class ExpandableUploadListAdapter extends BaseExpandableListAdapter imple
@Override
public int compare(OCUpload upload1, OCUpload upload2) {
if (upload1.getUploadStatus().equals(UploadStatus.UPLOAD_IN_PROGRESS)) {
if (!upload2.getUploadStatus().equals(UploadStatus.UPLOAD_IN_PROGRESS)) {
if (upload1 == null){
return -1;
}
if (upload2 == null){
return 1;
}
if (UploadStatus.UPLOAD_IN_PROGRESS.equals(upload1.getUploadStatus())) {
if (!UploadStatus.UPLOAD_IN_PROGRESS.equals(upload2.getUploadStatus())) {
return -1;
}
// both are in progress