Skip to content

Commit

Permalink
Merge pull request #2735 from mikepenz/fix/2732
Browse files Browse the repository at this point in the history
Protect against potential NPE for sticky footer items
  • Loading branch information
mikepenz authored Jul 20, 2021
2 parents 5a99f39 + 6cbddd6 commit 4c8edf5
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,18 @@ internal fun rebuildStickyFooterView(sliderView: MaterialDrawerSliderView) {

//fill the footer with items
fillStickyDrawerItemFooter(sliderView, it) { v ->
val drawerItem = v.getTag(R.id.material_drawer_item) as IDrawerItem<*>
onFooterDrawerItemClick(sliderView, drawerItem, v, true)
(v.getTag(R.id.material_drawer_item) as? IDrawerItem<*>)?.let { drawerItem ->
onFooterDrawerItemClick(sliderView, drawerItem, v, true)
}
}

it.visibility = View.VISIBLE
} ?: run {
//there was no footer yet. now just create one
handleFooterView(sliderView) { v ->
val drawerItem = v.getTag(R.id.material_drawer_item) as IDrawerItem<*>
onFooterDrawerItemClick(sliderView, drawerItem, v, true)
(v.getTag(R.id.material_drawer_item) as? IDrawerItem<*>)?.let { drawerItem ->
onFooterDrawerItemClick(sliderView, drawerItem, v, true)
}
}
}

Expand Down

0 comments on commit 4c8edf5

Please sign in to comment.