diff options
author | Andy Scherzinger <info@andy-scherzinger.de> | 2017-01-04 22:43:11 +0300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-01-04 22:43:11 +0300 |
commit | 0ede6c9127db4dab29a31d76b846265e3263cfe9 (patch) | |
tree | 2d1c220794dd1d08ee45e2229f398b04db57d578 | |
parent | ade4194c6b453149d82cae47e2d9ade2234ab286 (diff) | |
parent | 1219844d58b5bdeb670f00b06340d6369dd7b860 (diff) |
Merge pull request #505 from nextcloud/fixTimSortrc-1.4.1-01
try to fix TimSort, but it was just a plain NPE...
-rwxr-xr-x | src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java b/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java index 810f2f6146..d2fc54603e 100755 --- a/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java +++ b/src/com/owncloud/android/ui/adapter/ExpandableUploadListAdapter.java @@ -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 |