[NPE] Skip all apps icon preinflatioino on bg thread if layout manager is set to null
Fix: 355192472 Test: presubmit Flag: NONE - bug fix Change-Id: Icdac63c58983cd7bada5d75f0e257d45d48a8d2e
This commit is contained in:
@@ -108,6 +108,11 @@ class AllAppsRecyclerViewPool<T> : RecycledViewPool() {
|
||||
if (task?.canceled == true) {
|
||||
break
|
||||
}
|
||||
// If activeRv's layout manager has been reset to null on main thread, skip
|
||||
// the preinflation as we cannot generate correct LayoutParams
|
||||
if (activeRv.layoutManager == null) {
|
||||
break
|
||||
}
|
||||
list.add(
|
||||
adapter.createViewHolder(activeRv, BaseAllAppsAdapter.VIEW_TYPE_ICON)
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user