Skip to content

Commit

Permalink
Add a nullptr check in BrowserViewAsh
Browse files Browse the repository at this point in the history
During initialization step, the SadTabHelper can be null.

Bug: b/352576309
Change-Id: Ie5621ff17b279661c3c25383b9ae6d18582e593d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5697785
Commit-Queue: Zoraiz Naeem <[email protected]>
Reviewed-by: Elly FJ <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1326351}
  • Loading branch information
Zoraiz Naeem authored and Chromium LUCI CQ committed Jul 11, 2024
1 parent b83a31f commit 99110e9
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chrome/browser/ui/views/frame/browser_view_ash.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,13 @@
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#include "chrome/browser/ui/views/frame/browser_view_ash.h"

#include <algorithm>

#include "base/check.h"
#include "chrome/browser/ui/sad_tab_helper.h"
#include "chrome/browser/ui/views/frame/browser_view.h"
#include "chrome/browser/ui/views/frame/browser_view_ash.h"
#include "chrome/browser/ui/views/sad_tab_view.h"
#include "chrome/browser/ui/views/side_panel/side_panel.h"
#include "ui/gfx/geometry/rounded_corners_f.h"
Expand Down Expand Up @@ -108,7 +109,7 @@ void BrowserViewAsh::UpdateWindowRoundedCorners(int corner_radius) {
// changes.
if (auto* sad_tab_helper =
SadTabHelper::FromWebContents(contents_webview->web_contents());
sad_tab_helper->sad_tab()) {
sad_tab_helper && sad_tab_helper->sad_tab()) {
SadTabView* sad_tab_view =
static_cast<SadTabView*>(sad_tab_helper->sad_tab());
if (sad_tab_view->GetBackgroundRadii() != contents_webview_radii) {
Expand Down

0 comments on commit 99110e9

Please sign in to comment.