Skip to content

Commit 9b307f8

Browse files
authored
Merge pull request #23229 from brave/pr23227_fix_crash_when_tab_added_to_saved_group_1.66.x
Fixed crash when a tab is added to saved group (uplift to 1.66.x)
2 parents e3166fd + 00f7840 commit 9b307f8

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

browser/ui/views/bookmarks/saved_tab_groups/brave_saved_tab_group_button.cc

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,17 @@ void BraveSavedTabGroupButton::Initialize() {
3838
}
3939

4040
void BraveSavedTabGroupButton::UpdateButtonLayout() {
41+
// This seems called after this class is removed from widget.
42+
// If a tab is added to existing group and that tab is the only
43+
// tab in the current window, it seems that window is closed
44+
// when that group is in another window during this adding.
45+
// I think SavedTabGroupBar should stop observing SavedTabGroupModel
46+
// when it's removed from widget but it's upstream code and upstream
47+
// doesn't have this issue.
48+
if (!GetWidget()) {
49+
return;
50+
}
51+
4152
auto* cp = GetColorProvider();
4253

4354
// Note that upstream uses separate color IDs for the button background,

0 commit comments

Comments
 (0)