Skip to content

Commit 0ede6c9

Browse files
Merge pull request #505 from nextcloud/fixTimSort
try to fix TimSort, but it was just a plain NPE...
2 parents ade4194 + 1219844 commit 0ede6c9

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -94,8 +94,14 @@ public String getGroupName() {
9494

9595
@Override
9696
public int compare(OCUpload upload1, OCUpload upload2) {
97-
if (upload1.getUploadStatus().equals(UploadStatus.UPLOAD_IN_PROGRESS)) {
98-
if (!upload2.getUploadStatus().equals(UploadStatus.UPLOAD_IN_PROGRESS)) {
97+
if (upload1 == null){
98+
return -1;
99+
}
100+
if (upload2 == null){
101+
return 1;
102+
}
103+
if (UploadStatus.UPLOAD_IN_PROGRESS.equals(upload1.getUploadStatus())) {
104+
if (!UploadStatus.UPLOAD_IN_PROGRESS.equals(upload2.getUploadStatus())) {
99105
return -1;
100106
}
101107
// both are in progress

0 commit comments

Comments
 (0)