Skip to content

Commit

Permalink
Win32: Account for null return from get_accChild.
Browse files Browse the repository at this point in the history
  • Loading branch information
madewokherd committed Feb 10, 2025
1 parent 2346b0c commit 4d5f3ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion xalia/Win32/AccessibleProvider.cs
Original file line number Diff line number Diff line change
Expand Up @@ -864,8 +864,12 @@ private List<ElementIdentifier> GetChildrenAccChildBackground(int count)
for (int i = 0; i < count; i++)
{
var v = IAccessible.get_accChild(i + 1);
if (v is int vi && vi == CHILDID_SELF)
if (v is null)
{
// simple child - use parent IAccessible
result.Add(ElementIdFromVariantBackground(i + 1));
continue;
}
if (!seen.Add(v))
continue;
result.Add(ElementIdFromVariantBackground(v));
Expand Down

0 comments on commit 4d5f3ee

Please # to comment.