Skip to content

Commit

Permalink
[110][IOS] Check RLEntry when showing context menu
Browse files Browse the repository at this point in the history
It is possible that `ReadingListMediator entryFromItem:`
returns nullptr, so we must check for this before
dereferencing the pointer.

(cherry picked from commit 84e06b7)

Bug: 1401484
Change-Id: I150c3b38b2e869952f1405669f174489b0de87fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4118475
Reviewed-by: David Jean <[email protected]>
Commit-Queue: David Jean <[email protected]>
Auto-Submit: Olivier Robin <[email protected]>
Cr-Original-Commit-Position: refs/heads/main@{#1085836}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4120308
Commit-Queue: Olivier Robin <[email protected]>
Cr-Commit-Position: refs/branch-heads/5481@{#47}
Cr-Branched-From: 130f3e4-refs/heads/main@{#1084008}
  • Loading branch information
robinolivier authored and Chromium LUCI CQ committed Dec 22, 2022
1 parent 8259b97 commit abcc38d
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -453,7 +453,7 @@ - (UIContextMenuConfiguration*)contextMenuConfigurationForItem:
[menuElements addObject:openInNewIncognitoTab];

const ReadingListEntry* entry = [self.mediator entryFromItem:item];
if (entry->DistilledState() == ReadingListEntry::PROCESSED) {
if (entry && entry->DistilledState() == ReadingListEntry::PROCESSED) {
[menuElements
addObject:[actionFactory
actionToOpenOfflineVersionInNewTabWithBlock:^{
Expand Down

0 comments on commit abcc38d

Please sign in to comment.