open-cogsci / OpenSesame

Graphical experiment builder for the social sciences
http://osdoc.cogsci.nl/
GNU General Public License v3.0
236 stars 112 forks source link

Pressing a key in the overview area when no item is selected results in AttributeError #708

Closed smathot closed 4 years ago

smathot commented 4 years ago

In rare cases, the following AttributeError can arise when navigating the overview area. It's difficult to reproduce, but it seems to happen because the check whether there is a current item happens before processing the key press. Therefore, when the key press results in no item being selected, this error can occur.

Traceback (most recent call last):
  File "C:\Program Files (x86)\OpenSesame\Lib\site-packages\libqtopensesame\widgets\tree_overview.py", line 910, in keyPressEvent
    self.currentItem().open_tab()
AttributeError: 'NoneType' object has no attribute 'open_tab'