Commit 8c25e42e authored by Jenna Himawan's avatar Jenna Himawan Committed by Commit Bot

Don't update visual state for unbound BookmarkRows

Bug: 990534
Change-Id: Id3ac7d55cbf19c380d02a9c13ef1eeb7d71aea2d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1749212
Commit-Queue: Jenna Himawan <jhimawan@google.com>
Reviewed-by: default avatarTheresa  <twellington@chromium.org>
Reviewed-by: default avatarMatthew Jones <mdjones@chromium.org>
Cr-Commit-Position: refs/heads/master@{#686200}
parent 0d121845
......@@ -91,6 +91,13 @@ abstract class BookmarkRow extends SelectableItemView<BookmarkId>
}
private void updateVisualState() {
// This check is needed because it is possible for updateVisualState to be called between
// onDelegateInitialized (SelectionDelegate triggers a redraw) and setBookmarkId. View is
// not currently bound, so we can skip this for now. updateVisualState will run inside of
// setBookmarkId.
if (mBookmarkId == null) {
return;
}
BookmarkItem bookmarkItem = mDelegate.getModel().getBookmarkById(mBookmarkId);
// This check is needed because updateVisualState is called when the item has been deleted
// in the model but not in the adapter. If we hit this if-block, the
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment