From 1219844d58b5bdeb670f00b06340d6369dd7b860 Mon Sep 17 00:00:00 2001 From: tobiasKaminsky Date: Wed, 4 Jan 2017 20:24:26 +0100 Subject: [PATCH] try to fix TimSort, but it was just a plain NPE... --- .../ui/adapter/ExpandableUploadListAdapter.java | 10 ++++++++-- 1 file 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