From dd37013745d96e046fa742195c19cd5ee34bcf6f Mon Sep 17 00:00:00 2001 From: serrebidev Date: Wed, 15 Jul 2026 22:08:48 -0700 Subject: [PATCH] Guard getFixedNum against a None simpleFirstChild 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+ 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. --- addon/globalPlugins/columnsReview/__init__.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/addon/globalPlugins/columnsReview/__init__.py b/addon/globalPlugins/columnsReview/__init__.py index 1e69975..a1d7f02 100644 --- a/addon/globalPlugins/columnsReview/__init__.py +++ b/addon/globalPlugins/columnsReview/__init__.py @@ -790,6 +790,14 @@ def getColumnData(self, colNumber): def getFixedNum(self, num): curItem = api.getFocusObject() child = curItem.simpleFirstChild + # Some list implementations report childCount > 0 but expose no simple + # first child object (seen with wxWidgets wxListCtrl on recent wxWidgets + # builds). Without a first column we can't compute an invisible-column + # offset, so fall back to treating the pressed number as the 1-based + # column index instead of crashing on child.columnNumber (issue: bare + # Alt/NVDA+Ctrl+n raised "'NoneType' object has no attribute 'columnNumber'"). + if child is None or child.columnNumber is None: + return num startNum = child.columnNumber-1 if num == 1: return startNum+1