Commit 2cc32b36 authored by Aaron Leventhal's avatar Aaron Leventhal Committed by Commit Bot

Fix null dereference

Bug: 1124781,1124757
Change-Id: I36aa26810557cbc876ccf68e1fb458d9a18c00fd
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2392796Reviewed-by: default avatarDominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Dominic Mazzoni <dmazzoni@chromium.org>
Commit-Queue: Aaron Leventhal <aleventhal@chromium.org>
Auto-Submit: Aaron Leventhal <aleventhal@chromium.org>
Cr-Commit-Position: refs/heads/master@{#804372}
parent eb1a2f56
...@@ -831,10 +831,10 @@ void AXObjectCacheImpl::DeferTreeUpdateInternal(base::OnceClosure callback, ...@@ -831,10 +831,10 @@ void AXObjectCacheImpl::DeferTreeUpdateInternal(base::OnceClosure callback,
if (obj->IsDetached()) if (obj->IsDetached())
return; return;
Document& tree_update_document = *obj->GetDocument(); Document* tree_update_document = obj->GetDocument();
// Ensure the tree update document is in a good state. // Ensure the tree update document is in a good state.
if (!IsActive(tree_update_document)) if (!tree_update_document || !IsActive(*tree_update_document))
return; return;
if (tree_update_callback_queue_.size() >= max_pending_updates_) { if (tree_update_callback_queue_.size() >= max_pending_updates_) {
...@@ -845,10 +845,10 @@ void AXObjectCacheImpl::DeferTreeUpdateInternal(base::OnceClosure callback, ...@@ -845,10 +845,10 @@ void AXObjectCacheImpl::DeferTreeUpdateInternal(base::OnceClosure callback,
return; return;
} }
DCHECK(!tree_update_document.GetPage()->Animator().IsServicingAnimations() || DCHECK(!tree_update_document->GetPage()->Animator().IsServicingAnimations() ||
(tree_update_document.Lifecycle().GetState() < (tree_update_document->Lifecycle().GetState() <
DocumentLifecycle::kInAccessibility || DocumentLifecycle::kInAccessibility ||
tree_update_document.Lifecycle().StateAllowsDetach())) tree_update_document->Lifecycle().StateAllowsDetach()))
<< "DeferTreeUpdateInternal should only be outside of the lifecycle or " << "DeferTreeUpdateInternal should only be outside of the lifecycle or "
"before the accessibility state."; "before the accessibility state.";
tree_update_callback_queue_.push_back(MakeGarbageCollected<TreeUpdateParams>( tree_update_callback_queue_.push_back(MakeGarbageCollected<TreeUpdateParams>(
......
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