From ab038ce8a245d179dd99f8a0da29c2bfd180931b Mon Sep 17 00:00:00 2001 From: M66B Date: Mon, 29 Apr 2019 12:04:45 +0200 Subject: [PATCH] Prevent crash, cleanup --- app/src/main/java/eu/faircode/email/ActivitySetup.java | 3 +-- app/src/main/java/eu/faircode/email/ActivityView.java | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/ActivitySetup.java b/app/src/main/java/eu/faircode/email/ActivitySetup.java index 7c19fab438..7454ffbcb8 100644 --- a/app/src/main/java/eu/faircode/email/ActivitySetup.java +++ b/app/src/main/java/eu/faircode/email/ActivitySetup.java @@ -148,8 +148,7 @@ public class ActivitySetup extends ActivityBilling implements FragmentManager.On public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { int pos = parent.getChildAdapterPosition(view); NavMenuItem menu = adapter.get(pos); - Log.i("pos=" + pos + " separated=" + menu.isSeparated()); - outRect.set(0, 0, 0, menu.isSeparated() ? d.getIntrinsicHeight() : 0); + outRect.set(0, 0, 0, menu != null && menu.isSeparated() ? d.getIntrinsicHeight() : 0); } }; itemDecorator.setDrawable(d); diff --git a/app/src/main/java/eu/faircode/email/ActivityView.java b/app/src/main/java/eu/faircode/email/ActivityView.java index 1866d3e0db..c30da5988f 100644 --- a/app/src/main/java/eu/faircode/email/ActivityView.java +++ b/app/src/main/java/eu/faircode/email/ActivityView.java @@ -211,8 +211,7 @@ public class ActivityView extends ActivityBilling implements FragmentManager.OnB public void getItemOffsets(Rect outRect, View view, RecyclerView parent, RecyclerView.State state) { int pos = parent.getChildAdapterPosition(view); NavMenuItem menu = eadapter.get(pos); - Log.i("pos=" + pos + " separated=" + menu.isSeparated()); - outRect.set(0, 0, 0, menu.isSeparated() ? d.getIntrinsicHeight() : 0); + outRect.set(0, 0, 0, menu != null && menu.isSeparated() ? d.getIntrinsicHeight() : 0); } }; itemDecorator.setDrawable(d);