Commit 5c6d4933 authored by Joanmarie Diggs's avatar Joanmarie Diggs Committed by Commit Bot

Return early in AXNodeObject::InsertChild if CanHaveChildren is false

Fixes a crash.

Bug: 968014
Change-Id: I70b4aaea1d42c766920bebfcfb64e946b3499512
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1634748
Commit-Queue: Nektarios Paisios <nektar@chromium.org>
Auto-Submit: Joanmarie Diggs <jdiggs@igalia.com>
Reviewed-by: default avatarNektarios Paisios <nektar@chromium.org>
Cr-Commit-Position: refs/heads/master@{#664794}
parent b3afd6b4
...@@ -2355,7 +2355,7 @@ void AXNodeObject::AddChild(AXObject* child) { ...@@ -2355,7 +2355,7 @@ void AXNodeObject::AddChild(AXObject* child) {
} }
void AXNodeObject::InsertChild(AXObject* child, unsigned index) { void AXNodeObject::InsertChild(AXObject* child, unsigned index) {
if (!child) if (!child || !CanHaveChildren())
return; return;
// If the parent is asking for this child's children, then either it's the // If the parent is asking for this child's children, then either it's the
......
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