Skip to content

Commit

Permalink
[M118] OOBE: Fix ErrorScreen::ShowImpl() crash
Browse files Browse the repository at this point in the history
Check that `LoginDisplayHost::default_host()` does not return null
before accessing `LoginDisplayHost::default_host()->HasUserPods()`.

If `LoginDisplayHost::default_host()` returns null, it will be
assumed that the error is not closeable, similar to the behavior
before https://crrev.com/c/4720650 was landed.

(cherry picked from commit 6ba7237)

Bug: b:302369390
Change-Id: I4c450ee6a3673092bb307997ba323c586fe87941
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4898537
Commit-Queue: Danila Kuzmin <dkuzmin@google.com>
Auto-Submit: Osama Fathy <osamafathy@google.com>
Reviewed-by: Danila Kuzmin <dkuzmin@google.com>
Cr-Original-Commit-Position: refs/heads/main@{#1202394}
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4902243
Commit-Queue: Osama Fathy <osamafathy@google.com>
Cr-Commit-Position: refs/branch-heads/5993@{#957}
Cr-Branched-From: 5113507-refs/heads/main@{#1192594}
  • Loading branch information
Osama Fathy authored and Chromium LUCI CQ committed Sep 29, 2023
1 parent bb5cdd9 commit 6b6dc2d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions chrome/browser/ash/login/screens/error_screen.cc
Original file line number Diff line number Diff line change
Expand Up @@ -260,8 +260,9 @@ void ErrorScreen::ShowImpl() {
return;
}

const bool is_closeable =
LoginDisplayHost::default_host()->HasUserPods() && !is_persistent_;
const bool is_closeable = LoginDisplayHost::default_host() &&
LoginDisplayHost::default_host()->HasUserPods() &&
!is_persistent_;
view_->ShowScreenWithParam(is_closeable);
LOG(WARNING) << "Network error screen message is shown";
NetworkHandler::Get()->network_state_handler()->RequestPortalDetection();
Expand Down

0 comments on commit 6b6dc2d

Please sign in to comment.