planetfederal / qgis-milstd2525-plugin

GNU General Public License v2.0
13 stars 10 forks source link

Python error if the layer to render has no fields #9

Closed SrNetoChan closed 5 years ago

SrNetoChan commented 5 years ago

This happens if a user try to render a layer without any fields.

''' 2018-07-26T18:32:09 WARNING Traceback (most recent call last): File "/home/aneto/.local/share/QGIS/QGIS3/profiles/default/python/plugins/milstd2525/renderer.py", line 141, in createRendererWidget return MilStd2525RendererWidget(layer, style, renderer) File "/home/aneto/.local/share/QGIS/QGIS3/profiles/default/python/plugins/milstd2525/renderer.py", line 110, in init self.r = MilStd2525Renderer(field = fields[0]) IndexError: list index out of range '''

Would be nice to try escape the python error and send a message to the user instead.

volaya commented 5 years ago

should be fixed now in the qgis3 branch

SrNetoChan commented 5 years ago

Fixed