Spectral Library: Error when reseting Profile Style for unstyled spectrum

Issue #485 closed
Fabian Thiel created an issue

When the Reset Style button is used and no style is applied to this spectrum, an error shows up. Makes sense, but the error should be hidden, as this might confuse users, or communicated in the QMessageBar “Style already at default” (or similar)

An error has occurred while executing Python code: 

KeyError: 20 
Traceback (most recent call last):
  File "C:/Users/thielf54/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\gui.py", line 2295, in 
    lambda *args, fids=selectedFIDs: self.plotWidget().setProfileStyles(None, fids))
  File "C:/Users/thielf54/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\gui.py", line 1063, in setProfileStyles
    updatedFIDs = self.profileRenderer().setProfilePlotStyle(style, fids)
  File "C:/Users/thielf54/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\enmapboxplugin\enmapbox\externals\qps\speclib\core.py", line 1290, in setProfilePlotStyle
    self.mFID2Style.pop(fid)
KeyError: 20

Version 3.7.20200806T102627.develop

Comments (5)

  1. Log in to comment