Browse Source

wxGUI/lmgr: fix return 'Layer' class str value if map layer name is None (#820)

Fixes #814
Tomas Zigo 4 years ago
parent
commit
7ebe81d248
2 changed files with 3 additions and 2 deletions
  1. 2 1
      gui/wxpython/gui_core/forms.py
  2. 1 1
      gui/wxpython/lmgr/giface.py

+ 2 - 1
gui/wxpython/gui_core/forms.py

@@ -1460,7 +1460,8 @@ class CmdPanel(wx.Panel):
                                     for layer in layers:
                                         if layer.type != p.get('prompt'):
                                             continue
-                                        mapList.append(str(layer))
+                                        if str(layer):
+                                            mapList.append(str(layer))
                         selection = gselect.Select(
                             parent=which_panel, id=wx.ID_ANY,
                             size=globalvar.DIALOG_GSELECT_SIZE, type=elem,

+ 1 - 1
gui/wxpython/lmgr/giface.py

@@ -44,7 +44,7 @@ class Layer(object):
         return self._pydata[0].keys()
 
     def __str__(self):
-        return self.maplayer.name
+        return '' if self.maplayer.name is None else self.maplayer.name
 
 
 class LayerList(object):