Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix logged error when locking up the computer #95

Merged
merged 1 commit into from
Mar 29, 2024

Conversation

CyrilleB79
Copy link
Contributor

Hi Woody

Here is a PR fixing a a little issue; there is no functional issue though.

Issue

When locking the computer (Windows+l)or switching to a secure screen, an error message is logged:

ERROR - NVDAObjects.__call__ (11:30:31.558) - MainThread (8364):
Exception in chooseNVDAObjectOverlayClasses for GlobalPlugin ('globalPlugins.Access8Math')
Traceback (most recent call last):
  File "NVDAObjects\__init__.pyc", line 118, in __call__
  File "C:\Users\Cyrille\AppData\Roaming\nvda\addons\Access8Math\globalPlugins\Access8Math\__init__.py", line 204, in chooseNVDAObjectOverlayClasses
    if obj.windowClassName == "wxWindowNR" and obj.role == ROLE_WINDOW and obj.name == _("Access8Math interaction window"):
       ^^^^^^^^^^^^^^^^^^^
AttributeError: '_SecureDesktopNVDAObject' object has no attribute 'windowClassName'

The error is due to the fact that not all NVDAObject's are Window objects and thus, not all have a windowClassName attribute. More specifically, the secure screen object is not an object corresponding to a real window.

This error does not cause functional issue but having error that should be ignored in the log is disturbing when performing other debug tasks.

Solution

Try to get the windowClassName attribute and return None if it is missing.

@tsengwoody tsengwoody merged commit 5c35154 into tsengwoody:master Mar 29, 2024
2 checks passed
@CyrilleB79 CyrilleB79 deleted the lockError branch March 29, 2024 10:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants