From 6e9b59923354eca809eb8e056ce62fbd5bc8b065 Mon Sep 17 00:00:00 2001 From: Distopico Vegan Date: Tue, 6 Nov 2018 07:05:24 -0500 Subject: [PATCH] fix: null check on empty search fallback --- app/src/main/java/org/dystopia/email/FragmentMessages.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/org/dystopia/email/FragmentMessages.java b/app/src/main/java/org/dystopia/email/FragmentMessages.java index ae764e8f..72d83471 100644 --- a/app/src/main/java/org/dystopia/email/FragmentMessages.java +++ b/app/src/main/java/org/dystopia/email/FragmentMessages.java @@ -1055,7 +1055,7 @@ public class FragmentMessages extends FragmentEx { break; } } else { - if (searchCallback == null) + if (searchCallback == null) { searchCallback = new BoundaryCallbackMessages(this, model, new BoundaryCallbackMessages.IBoundaryCallbackMessages() { @Override @@ -1067,8 +1067,9 @@ public class FragmentMessages extends FragmentEx { @Override public void onLoaded() { pbWait.setVisibility(View.GONE); - if (messages.getValue().size() == 0) + if (messages.getValue() == null || messages.getValue().size() == 0) { tvNoEmail.setVisibility(View.VISIBLE); + } } @Override @@ -1081,7 +1082,7 @@ public class FragmentMessages extends FragmentEx { .show(); } }); - + } PagedList.Config config = new PagedList.Config.Builder() .setPageSize(LOCAL_PAGE_SIZE) .setInitialLoadSizeHint(LOCAL_PAGE_SIZE)