Commit 8a9f744d authored by jamescook's avatar jamescook Committed by Commit bot

cros: Fix clusterfuzz crash opening stylus palette

Clusterfuzz skips the login pathway and injects keystrokes immediately on
startup. This can trigger accelerators before the status area is initialized.
Add a null check -- this case doesn't happen in production.

BUG=702480
TEST=clusterfuzz

Review-Url: https://codereview.chromium.org/2758863002
Cr-Commit-Position: refs/heads/master@{#457827}
parent b471e562
......@@ -514,9 +514,11 @@ void HandleShowStylusTools() {
RootWindowController* root_window_controller =
Shell::GetWmRootWindowForNewWindows()->GetRootWindowController();
PaletteTray* palette_tray =
root_window_controller->GetShelf()->GetStatusAreaWidget()->palette_tray();
palette_tray->ShowPalette();
StatusAreaWidget* status_area_widget =
root_window_controller->GetShelf()->GetStatusAreaWidget();
// Tests (clusterfuzz) can trigger this before the status area is ready.
if (status_area_widget)
status_area_widget->palette_tray()->ShowPalette();
}
bool CanHandleShowStylusTools() {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment