Merge pull request #1 from egeniq-forks/develop/fix_crash

Fix crash if adapter is empty
This commit is contained in:
Little Mango
2018-08-29 17:38:13 +08:00
committed by GitHub

View File

@ -278,6 +278,10 @@ class StackLayoutManager(scrollOrientation: ScrollOrientation,
}
override fun onLayoutChildren(recycler: RecyclerView.Recycler, state: RecyclerView.State) {
if (itemCount == 0) {
return
}
mLayout?.requestLayout()
removeAndRecycleAllViews(recycler)