From 4122992df55c90228c7d3254e722d60cf3d2c54c Mon Sep 17 00:00:00 2001 From: Mariotaku Lee Date: Fri, 18 Mar 2016 00:34:02 +0800 Subject: [PATCH] fixed npe --- .../twidere/adapter/ParcelableStatusesAdapter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/twidere/src/main/java/org/mariotaku/twidere/adapter/ParcelableStatusesAdapter.java b/twidere/src/main/java/org/mariotaku/twidere/adapter/ParcelableStatusesAdapter.java index 7bb176a17..c67e9a077 100644 --- a/twidere/src/main/java/org/mariotaku/twidere/adapter/ParcelableStatusesAdapter.java +++ b/twidere/src/main/java/org/mariotaku/twidere/adapter/ParcelableStatusesAdapter.java @@ -190,10 +190,10 @@ public abstract class ParcelableStatusesAdapter extends LoadMoreSupportAdapter data) { mData = data; - if (!(data instanceof ObjectCursor) && !data.isEmpty()) { - mLastItemFiltered = data.get(data.size() - 1).is_filtered; - } else { + if (data instanceof ObjectCursor || data == null || data.isEmpty()) { mLastItemFiltered = false; + } else { + mLastItemFiltered = data.get(data.size() - 1).is_filtered; } notifyDataSetChanged(); }