LettError / designSpaceRoboFontExtension

A RoboFont extension for creating and editing designspace documents.
MIT License
29 stars 6 forks source link

Sorting instances before using name popover causes index error #97

Open ryanbugden opened 4 months ago

ryanbugden commented 4 months ago

There seems to be an index mismatch after sorting, when dealing with the new popover from https://github.com/LettError/designSpaceRoboFontExtension/pull/92

Reproduce:

One of the interactions will cause this traceback.

Current workaround:

Traceback (most recent call last):
  File "lib/doodleDelegate.pyc", line 90, in sendEvent_
  File "lib/cells/doubleClickCell.pyc", line 21, in hitTestForEvent_inRect_ofView_
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py", line 1463, in instancesListDoubleClickCallback
    self.instancesPopover = InstancesAttributesPopover(self.instances.list, self.operator, closeCallback=self.instancesChanged)
                            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/Users/Ryan/Library/Application Support/RoboFont/plugins/DesignspaceEditor2.roboFontExt/lib/designspaceEditor/ui.py", line 435, in __init__
    index = listView.getSelection()[0]
            ~~~~~~~~~~~~~~~~~~~~~~~^^^
IndexError: list index out of range