Skip to content

Commit

Permalink
Merge pull request #505 from nextcloud/fixTimSort
Browse files Browse the repository at this point in the history
try to fix TimSort, but it was just a plain NPE...
  • Loading branch information
AndyScherzinger authored Jan 4, 2017
2 parents ade4194 + 1219844 commit 0ede6c9
Showing 1 changed file with 8 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@ public String getGroupName() {

@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
Expand Down

0 comments on commit 0ede6c9

Please sign in to comment.