Prevent NPE

pull/214/head
M66B 1 year ago
parent 85ee7f1d5d
commit 17c27e72d2

@ -3250,8 +3250,11 @@ public class FragmentMessages extends FragmentBase
private void redraw(RecyclerView.ViewHolder vh) { private void redraw(RecyclerView.ViewHolder vh) {
if (vh != null) if (vh != null)
try { try {
rvMessage.getLayoutManager().detachView(vh.itemView); RecyclerView.LayoutManager lm = rvMessage.getLayoutManager();
rvMessage.getLayoutManager().removeDetachedView(vh.itemView); if (lm != null) {
lm.detachView(vh.itemView);
lm.removeDetachedView(vh.itemView);
}
} catch (Throwable ex) { } catch (Throwable ex) {
Log.e(ex); Log.e(ex);
} }

Loading…
Cancel
Save