浏览代码

wxGUI/dbmgr: fix clik on the 'Modify layer' button if vector map doesn't have any layers (#1334)

Tomas Zigo 4 年之前
父节点
当前提交
c160974994
共有 1 个文件被更改,包括 5 次插入1 次删除
  1. 5 1
      gui/wxpython/dbmgr/base.py

+ 5 - 1
gui/wxpython/dbmgr/base.py

@@ -3728,7 +3728,11 @@ class LayerBook(wx.Notebook):
     def OnModifyLayer(self, event):
         """Modify layer connection settings"""
 
-        layer = int(self.modifyLayerWidgets['layer'][1].GetStringSelection())
+        layer = self.modifyLayerWidgets['layer'][1].GetStringSelection()
+        if not layer:
+            return
+
+        layer = int(layer)
 
         modify = False
         if self.modifyLayerWidgets['driver'][1].GetStringSelection() != \