Skip to content
Snippets Groups Projects
Commit 2c0a47e8 authored by Benjamin Williams's avatar Benjamin Williams Committed by Chromium LUCI CQ
Browse files

[iOS] Prevent Magic Stack crash after toggling on/off Tips module

This CL fixes a crash that occurs when toggling Chrome tips on and off
in the Magic Stack edit carousel, followed by reloading the homepage.
The crash happens because the Tips module is re-added to the Magic Stack
without a valid TipsMagicStackMediator.

This fix ensures that a valid TipsMagicStackMediator exists before
re-adding the Tips module, allowing the module to be correctly
constructed, interacted with, and properly managed within the Magic
Stack's lifecycle.

Fixed: 374313240
Change-Id: Ic86c73a2a250102b87b4a116414a7b84daee0cad
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5952624


Commit-Queue: Benjamin Williams <bwwilliams@google.com>
Auto-Submit: Benjamin Williams <bwwilliams@google.com>
Reviewed-by: default avatarChris Lu <thegreenfrog@chromium.org>
Commit-Queue: Chris Lu <thegreenfrog@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1371991}
parent 3e9e2826
No related branches found
No related tags found
No related merge requests found
......@@ -690,7 +690,7 @@ using segmentation_platform::home_modules::TipsEphemeralModule;
break;
case ContentSuggestionsModuleType::kTips:
case ContentSuggestionsModuleType::kTipsWithProductImage: {
if (IsTipsMagicStackEnabled()) {
if (IsTipsMagicStackEnabled() && _tipsMediator && _tipsMediator.state) {
[magicStackOrder addObject:_tipsMediator.state];
}
break;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment