Fix potential NPE in MediaOverviewPageFragment.
This commit is contained in:
parent
159f2ebec0
commit
c359207f1f
1 changed files with 5 additions and 3 deletions
|
@ -211,9 +211,11 @@ public final class MediaOverviewPageFragment extends Fragment
|
|||
@Override
|
||||
public void onDestroy() {
|
||||
super.onDestroy();
|
||||
int childCount = recyclerView.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
adapter.detach(recyclerView.getChildViewHolder(recyclerView.getChildAt(i)));
|
||||
if (recyclerView != null) {
|
||||
int childCount = recyclerView.getChildCount();
|
||||
for (int i = 0; i < childCount; i++) {
|
||||
adapter.detach(recyclerView.getChildViewHolder(recyclerView.getChildAt(i)));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue