A gui.nvdaControls.MessageDialog with default type of standard, should no longer throw a None conversion exception#16223
Merged
Conversation
See test results for failed build of commit de6c3c19d3 |
…longer throws a None conversion exception because no sound is assigned.
Adriani90
pushed a commit
to Adriani90/nvda
that referenced
this pull request
Mar 13, 2024
…longer throws a None conversion exception because no sound is assigned. (nvaccess#16223) Summary of the issue: Using gui.nvdaControls.MessageDialog with standard type (the default), generates this exception: ERROR - unhandled exception (03:21:22.395) - MainThread (16784): Traceback (most recent call last): File "gui\nvdaControls.pyc", line 335, in _onShowEvt File "gui\nvdaControls.pyc", line 294, in _playSound TypeError: 'NoneType' object cannot be interpreted as an integer This is happening because there is no sound assigned for standard type dialogs, but the method which plays sound does not check for this. Which, ironically, caused a sound, at least in test builds. Description of user facing changes Beta/alpha users will no longer hear an error sound when one of these is used. Description of development approach Check whether the int is actually a None, before trying to play the sound. If so, don't play it.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Link to issue number:
None
Summary of the issue:
Using
gui.nvdaControls.MessageDialogwith standard type (the default), generates this exception:This is happening because there is no sound assigned for standard type dialogs, but the method which plays sound does not check for this. Which, ironically, caused a sound, at least in test builds.
Description of user facing changes
Beta/alpha users will no longer hear an error sound when one of these is used.
Description of development approach
Check whether the int is actually a None, before trying to play the sound. If so, don't play it.
Testing strategy:
TBD
Known issues with pull request:
none
Code Review Checklist: