Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 8e3a6064 authored by Sunny Goyal's avatar Sunny Goyal
Browse files

Fixing crash when the adapter is no longer available

Bug: 197176748
Test: trivial change
Change-Id: Ie55a248c1998168c45bfa346186d61d7456ff7fb
parent 494bbb0b
Loading
Loading
Loading
Loading
+7 −4
Original line number Diff line number Diff line
@@ -110,10 +110,13 @@ public final class WidgetsListTableViewHolderBinder

                // When preview loads, notify adapter to rebind the item and possibly animate
                widget.applyFromCellItem(widgetItem, 1f,
                        bitmap -> holder.getBindingAdapter().notifyItemChanged(
                        bitmap -> {
                        if (holder.getBindingAdapter() != null) {
                            holder.getBindingAdapter().notifyItemChanged(
                                    holder.getBindingAdapterPosition(),
                                Pair.create(widgetItem, bitmap)),
                        holder.previewCache.get(widgetItem));
                                    Pair.create(widgetItem, bitmap));
                            }
                        }, holder.previewCache.get(widgetItem));
            }
        }
    }