From 885133dbdc9c286e6b8bc865202a50d286c3dc9c Mon Sep 17 00:00:00 2001 From: Mike Penz Date: Sat, 11 Nov 2017 21:35:56 +0100 Subject: [PATCH] * prevent a nullpointerexception * FIX #2106 --- .../src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java b/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java index 75eee3778..9c17c5ce9 100644 --- a/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java +++ b/library/src/main/java/com/mikepenz/materialdrawer/MiniDrawer.java @@ -487,7 +487,8 @@ public boolean onClick(View v, IAdapter adapter, final IDrawerItem if (mAccountHeader != null && mAccountHeader.isSelectionListShown()) { mAccountHeader.toggleSelectionList(v.getContext()); } - if (!mDrawer.getDrawerItem(item.getIdentifier()).isSelected()) { + IDrawerItem drawerItem = mDrawer.getDrawerItem(item.getIdentifier()); + if (drawerItem != null && !drawerItem.isSelected()) { //set the selection mDrawer.setSelection(item, true); }