From cc930c65b76012d420b84db09f7589ac7624e34c Mon Sep 17 00:00:00 2001 From: Ammar Githam Date: Thu, 19 Nov 2020 18:52:40 +0900 Subject: [PATCH] Null checks. Fixes https://github.com/austinhuang0131/barinsta/issues/303 --- .../instagrabber/customviews/PostsRecyclerView.java | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/awais/instagrabber/customviews/PostsRecyclerView.java b/app/src/main/java/awais/instagrabber/customviews/PostsRecyclerView.java index 0524cff7..e5771537 100644 --- a/app/src/main/java/awais/instagrabber/customviews/PostsRecyclerView.java +++ b/app/src/main/java/awais/instagrabber/customviews/PostsRecyclerView.java @@ -283,9 +283,13 @@ public class PostsRecyclerView extends RecyclerView { } public void refresh() { - lazyLoader.resetState(); - postFetcher.reset(); - postFetcher.fetch(); + if (lazyLoader != null) { + lazyLoader.resetState(); + } + if (postFetcher != null) { + postFetcher.reset(); + postFetcher.fetch(); + } dispatchFetchStatus(); }