cvhciKIT / sloth

Sloth is a tool for labeling image and video data for computer vision research.
Other
608 stars 198 forks source link

fix crash on first launch #101

Closed wassname closed 7 years ago

wassname commented 7 years ago

When there is no previous state you get a segmentation fault. This fixes it.

Experienced by me and also kaggle user Jeffrey Richley. Fault trace:

Traceback (most recent call last):
  File "./bin/sloth", line 16, in <module>
    labeltool.execute_from_commandline(sys.argv)
  File "C:\personal\kaggle\sloth\sloth\core\labeltool.py", line 152, in execute_from_commandline
    self._mainwindow = MainWindow(self)
  File "C:\personal\kaggle\sloth\sloth\gui\labeltool.py", line 74, in __init__
    self.loadApplicationSettings()
  File "C:\personal\kaggle\sloth\sloth\gui\labeltool.py", line 308, in loadApplicationSettings
    self.restoreState(state)
TypeError: QMainWindow.restoreState(QByteArray, int version=0): argument 1 has unexpected type 'NoneType'
nilsonholger commented 7 years ago

@wassname Thank you very much for that pull request. Since I got absolutely no objections to it, the fix is quite obvious, I've merged it.