Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
UIA browseModeDocumentTreeInterceptor's __contains__ method: catch CO…
…MError when fetching runtimeID from a dea ddocument.
  • Loading branch information
michaelDCurran committed Nov 2, 2023
commit 79433550f9ab13c2a5e2efbf0d245ae9616bcd18
11 changes: 10 additions & 1 deletion source/UIAHandler/browseMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@
import cursorManager
import textInfos
import browseMode
from logHandler import log
from NVDAObjects.UIA import UIA

class UIADocumentWithTableNavigation(documentBase.DocumentWithTableNavigation):
Expand Down Expand Up @@ -519,7 +520,15 @@ def __contains__(self,obj):
return False
# Ensure that this object is a descendant of the document or is the document itself.
runtimeID=VARIANT()
self.rootNVDAObject.UIAElement._IUIAutomationElement__com_GetCurrentPropertyValue(UIAHandler.UIA_RuntimeIdPropertyId,byref(runtimeID))
try:
self.rootNVDAObject.UIAElement._IUIAutomationElement__com_GetCurrentPropertyValue(
UIAHandler.UIA_RuntimeIdPropertyId, byref(runtimeID)
)
except COMError:
log.debugWarning(
"Could not get runtimeID of document. Most likely document is dead."
)
return False
UIACondition=UIAHandler.handler.clientObject.createPropertyCondition(UIAHandler.UIA_RuntimeIdPropertyId,runtimeID)
UIAWalker=UIAHandler.handler.clientObject.createTreeWalker(UIACondition)
try:
Expand Down