Skip to content

Commit

Permalink
wxGUI/lmgr: fix return 'Layer' class str value if map layer name is N…
Browse files Browse the repository at this point in the history
…one (#820)

Fixes #814
  • Loading branch information
tmszi authored and petrasovaa committed Jul 23, 2020
1 parent b8ed391 commit e6fec54
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion gui/wxpython/gui_core/forms.py
Expand Up @@ -1460,7 +1460,8 @@ def __init__(self, parent, giface, task, id=wx.ID_ANY,
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,
Expand Down
2 changes: 1 addition & 1 deletion gui/wxpython/lmgr/giface.py
Expand Up @@ -44,7 +44,7 @@ def __dir__(self):
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):
Expand Down

0 comments on commit e6fec54

Please sign in to comment.