Guard getFixedNum against a None simpleFirstChild - #50
Conversation
script_readColumn crashes with "'NoneType' object has no attribute 'columnNumber'" on some list controls that report childCount > 0 but expose no simple first child object. This is reproducible with wxWidgets wxListCtrl on recent wxWidgets builds (3.2.x): NVDA+Ctrl+<n> fails on every row of the list. getFixedNum reads simpleFirstChild.columnNumber to compute the invisible-column offset. When there is no first child, fall back to treating the pressed number as the 1-based column index instead of raising, so the add-on degrades to a normal column read (or "no more visible columns") rather than an error dialog.
|
The failing I checked out I've opened #51, which fixes the check itself; it builds green. If you'd like, I'm happy to rebase this PR on top of that once you've decided what to do with it. The bug this fixes is unrelated to any of that: |
Problem
script_readColumn(NVDA+Ctrl+<n>) crashes on some list controls with:getFixedNumreadscurItem.simpleFirstChild.columnNumberto work out the invisible-column offset, butsimpleFirstChildcan beNoneeven whenchildCount > 0.Reproduction
Reproducible on a
wxWidgetswxListCtrl(report view) on recent wxWidgets 3.2.x builds (via wxPython): NVDA reports the focused list item has columns (childCount > 0) but exposes no simple first child, so every row of the list fails with the error above. (Originally reported against a wxPython app, NVDA 2026.2beta.)Fix
When there is no usable first child, fall back to treating the pressed number as the 1-based column index instead of raising. The add-on then degrades gracefully to a normal column read (or the existing "no more visible columns" path) rather than an error dialog. No behavior change for lists that already expose a first child.