From 6a237304a0809747f79e5b92ec5e8c09041258af Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 21 Oct 2019 09:16:33 +0200 Subject: [PATCH] Prevent crash --- app/src/main/java/eu/faircode/email/FragmentMessages.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 7d57da28d9..1c18988cdc 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -474,7 +474,8 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. DividerItemDecoration itemDecorator = new DividerItemDecoration(getContext(), llm.getOrientation()) { @Override public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { - if (view.findViewById(R.id.clItem).getVisibility() == View.GONE) + View clItem = view.findViewById(R.id.clItem); + if (clItem == null || clItem.getVisibility() == View.GONE) outRect.setEmpty(); else super.getItemOffsets(outRect, view, parent, state);