From 1cc21896b784436ecbbd76e74713834c66932511 Mon Sep 17 00:00:00 2001 From: Austin Huang Date: Wed, 9 Sep 2020 15:59:16 -0400 Subject: [PATCH] crash resolution --- .../main/java/awais/instagrabber/adapters/FeedAdapter.java | 4 ++-- .../java/awais/instagrabber/customviews/RamboTextView.java | 2 +- .../awais/instagrabber/fragments/SavedViewerFragment.java | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/adapters/FeedAdapter.java b/app/src/main/java/awais/instagrabber/adapters/FeedAdapter.java index 7ed66356..09623f3f 100755 --- a/app/src/main/java/awais/instagrabber/adapters/FeedAdapter.java +++ b/app/src/main/java/awais/instagrabber/adapters/FeedAdapter.java @@ -68,8 +68,8 @@ public final class FeedAdapter extends ListAdapter { - longClickListener.onLongClick(this); + if (longClickListener != null) longClickListener.onLongClick(this); }; public RamboTextView(final Context context) { diff --git a/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java b/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java index 9af8c42f..68dde31e 100644 --- a/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java +++ b/app/src/main/java/awais/instagrabber/fragments/SavedViewerFragment.java @@ -106,7 +106,7 @@ public final class SavedViewerFragment extends Fragment implements SwipeRefreshL @Override public void onResult(final PostModel[] result) { final List current = postsViewModel.getList().getValue(); - if (result != null) { + if (result != null && result.length > 0) { final List resultList = Arrays.asList(result); if (current == null) { postsViewModel.getList().postValue(resultList);