Commit a2763aa7 authored by Dominic Mazzoni's avatar Dominic Mazzoni Committed by Commit Bot

RootView::GetAccessibleNodeData should null-check widget_delegate.

The widget delegate can be null when the native widget is destroyed.

Bug: 678889
Change-Id: Id6e24aceeec59caea48b736309b63a1301823136
Reviewed-on: https://chromium-review.googlesource.com/833181
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Reviewed-by: default avatarTrent Apted <tapted@chromium.org>
Cr-Commit-Position: refs/heads/master@{#533753}
parent 9af875ff
......@@ -50,7 +50,8 @@ const ui::AXUniqueId& ViewAccessibility::GetUniqueId() const {
void ViewAccessibility::GetAccessibleNodeData(ui::AXNodeData* data) const {
// Views may misbehave if their widget is closed; return an unknown role
// rather than possibly crashing.
if (!owner_view_->GetWidget() || owner_view_->GetWidget()->IsClosed()) {
views::Widget* widget = owner_view_->GetWidget();
if (!widget || !widget->widget_delegate() || widget->IsClosed()) {
data->role = ax::mojom::Role::kUnknown;
data->SetRestriction(ax::mojom::Restriction::kDisabled);
return;
......
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