diff --git a/changes/2665.misc.rst b/changes/2665.misc.rst new file mode 100644 index 0000000000..0161579c1e --- /dev/null +++ b/changes/2665.misc.rst @@ -0,0 +1 @@ +An error raised and ignored during testbed testing on Winforms was silenced. diff --git a/winforms/src/toga_winforms/widgets/table.py b/winforms/src/toga_winforms/widgets/table.py index bb4689f7d1..242ac7be5f 100644 --- a/winforms/src/toga_winforms/widgets/table.py +++ b/winforms/src/toga_winforms/widgets/table.py @@ -171,11 +171,13 @@ def text(attr): [text(attr) for attr in self._accessors], ) - # TODO: ListView only has built-in support for one icon per row. One possible - # workaround is in https://stackoverflow.com/a/46128593. - icon = icon(self._accessors[0]) - if icon is not None: - lvi.ImageIndex = self._image_index(icon) + # If the table has accessors, populate the icons for the table. + if self._accessors: + # TODO: ListView only has built-in support for one icon per row. One possible + # workaround is in https://stackoverflow.com/a/46128593. + icon = icon(self._accessors[0]) + if icon is not None: + lvi.ImageIndex = self._image_index(icon) return lvi