Catch LookupError when getting NVDAObject from offset in virtual buffers #8665
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:
Fixes #8667, regression caused by #8479. Originally reported by @ruifontes via mail
Summary of the issue (steps to reproduce):
Open the following in Firefox:
data:text/html, <p></p>
Navigate through the empty buffer.
Actual result
An error sound is played. The following is printed in the log:
Log snippet
Expected result
NVDA just says blank.
Description of how this pull request fixes the issue:
With #8479, I introduced raising a LookupError for cases where both the vbuf handle and id of for an offset are 0 when executing _getFieldIdentifierFromOffset, since this is an invalid case. However, LookupErrors wheren't caught in _getNVDAObjectFromOffset. With this pr, they are, and an additional debugWarning is logged.
Note that the old path (pre #8479) was as follows:
Testing performed:
Tested the case as described above. Also made sure that _get_fieldIdentifierFromOffset isn't called elsewhere where this could cause an issue due to a not caught LookupError.
Known issues with pull request:
None
Change log entry:
None