Riverscapes/QRAVEPlugin

Canceling Options throws error

Closed this issue · 2 comments

Steps to Reproduce

  1. Version 0.9.0
  2. Open Options
  3. Cancel Options

Observed

Screenshot 2024-01-29 at 1 28 56 PM
An error has occurred while executing Python code: 

AttributeError: 'NoneType' object has no attribute 'text' 
Traceback (most recent call last):
  File "C:\Users/philip/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\riverscapes_viewer\src\dock_widget.py", line 143, in reload_tree
    basemap_states = get_checked_state(self.model.indexFromItem(self.basemaps.regions[region]), basemap_states)
  File "C:\Users/philip/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins\riverscapes_viewer\src\dock_widget.py", line 128, in get_checked_state
    output.append((item.text(), expanded))
AttributeError: 'NoneType' object has no attribute 'text'


Python version: 3.9.5 (tags/v3.9.5:0a7dcbd, May  3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)] 
QGIS version: 3.22.11-Białowieża Białowieża, 106d33d7 

Python Path:
C:/PROGRA~1/QGIS32~1.11/apps/qgis-ltr/./python
C:/Users/philip/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:/Users/philip/AppData/Roaming/QGIS/QGIS3\profiles\default/python/plugins
C:/PROGRA~1/QGIS32~1.11/apps/qgis-ltr/./python/plugins
C:\Program Files\QGIS 3.22.11\bin\python39.zip
C:\PROGRA~1\QGIS32~1.11\apps\Python39\DLLs
C:\PROGRA~1\QGIS32~1.11\apps\Python39\lib
C:\Program Files\QGIS 3.22.11\bin
C:\PROGRA~1\QGIS32~1.11\apps\Python39
C:\PROGRA~1\QGIS32~1.11\apps\Python39\lib\site-packages
C:\PROGRA~1\QGIS32~1.11\apps\Python39\lib\site-packages\win32
C:\PROGRA~1\QGIS32~1.11\apps\Python39\lib\site-packages\win32\lib
C:\PROGRA~1\QGIS32~1.11\apps\Python39\lib\site-packages\Pythonwin
C:/Users/philip/AppData/Roaming/QGIS/QGIS3\profiles\default/python
C:\Users\philip\AppData\Roaming\QGIS\QGIS3\profiles\default\python\plugins\qris_deploy\src\..\wheels\rsxml-2.0.1-py3-none-any.whl

Update: A few users at the Idaho workshop encountered this error. Restarting qgis resolved the issue.

Not sure of the exact cause, but should add some logic to catch None type items at this part of the code to prevent the error.

Fixed for 0.9.1