Skip to content

Commit

Permalink
Catch null com pointer access when fetching UIA children for UIA grid…
Browse files Browse the repository at this point in the history
… rows
  • Loading branch information
Leonard de Ruijter committed Mar 28, 2018
1 parent aef52b8 commit be37594
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions source/appModules/outlook.py
Expand Up @@ -447,10 +447,13 @@ def _get_name(self):
childrenCacheRequest.addProperty(UIAHandler.UIA_NamePropertyId)
childrenCacheRequest.addProperty(UIAHandler.UIA_TableItemColumnHeaderItemsPropertyId)
childrenCacheRequest.TreeScope=UIAHandler.TreeScope_Children
# #7949: A cache request without tree filter causes a NULL COM pointer access error
# when fetching the length of the cached children array.
childrenCacheRequest.treeFilter=UIAHandler.handler.clientObject.CreatePropertyCondition(UIAHandler.UIA_IsContentElementPropertyId, True)
cachedChildren=self.UIAElement.buildUpdatedCache(childrenCacheRequest).getCachedChildren()
if not cachedChildren:
# GetCachedChildren returns null if there are no children.
# This is unexpected here.
log.debugWarning("Unable to get relevant children for UIAGridRow", exc_info=True)
return super(UIAGridRow, self).name
for index in xrange(cachedChildren.length):
e=cachedChildren.getElement(index)
isFlag = e.cachedClassName=="FlagField"
Expand Down

0 comments on commit be37594

Please sign in to comment.