Commit 06eec72e authored by sczs's avatar sczs Committed by Commit Bot

[ios] Checks if Bookmarks rootNode is not nullptr before caching row.

I've been trying to figure out why this is happening, my theory is that
this is somehow related to swipe down to dismiss (the crash is iOS13
only) and dismissWithURL being called twice (the second time _rootNode
might've been niled).

Though I'm not sure why this didn't happen on M80 where this behavior
existed. So I'm not sure what could've changed that caused this crash.

This is a speculative fix, but modifying the code and setting _rootNode
to nullptr reproduces the crash stack exactly. Even if we'd know the
root cause, I'm not sure we'd want to cherrypick something more complex
than this to M81.

Bug: 1061882
Change-Id: Ic47449388e57e17c8acc34e104cc297dc8c2638d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2147955
Commit-Queue: Sergio Collazos <sczs@chromium.org>
Reviewed-by: default avatarEugene But <eugenebut@chromium.org>
Cr-Commit-Position: refs/heads/master@{#759413}
parent b03e05c1
...@@ -497,10 +497,17 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) { ...@@ -497,10 +497,17 @@ std::vector<GURL> GetUrlsToOpen(const std::vector<const BookmarkNode*>& nodes) {
- (void)cacheIndexPathRow { - (void)cacheIndexPathRow {
// Cache IndexPathRow for BookmarkTableView. // Cache IndexPathRow for BookmarkTableView.
int topMostVisibleIndexPathRow = [self topMostVisibleIndexPathRow]; int topMostVisibleIndexPathRow = [self topMostVisibleIndexPathRow];
[BookmarkPathCache if (_rootNode) {
cacheBookmarkTopMostRowWithPrefService:self.browserState->GetPrefs() [BookmarkPathCache
folderId:_rootNode->id() cacheBookmarkTopMostRowWithPrefService:self.browserState->GetPrefs()
topMostRow:topMostVisibleIndexPathRow]; folderId:_rootNode->id()
topMostRow:topMostVisibleIndexPathRow];
} else {
// TODO(crbug.com/1061882):Remove DCHECK once we know the root cause of the
// bug, for now this will cause a crash on Dev/Canary and we should get
// breadcrumbs.
DCHECK(NO);
}
} }
#pragma mark - BookmarkHomeConsumer #pragma mark - BookmarkHomeConsumer
......
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