Переглянути джерело

wxGUI: don't crash when vdigit props are not set
(merge from devbr6, https://trac.osgeo.org/grass/changeset/38012)


git-svn-id: https://svn.osgeo.org/grass/grass/trunk@38013 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 16 роки тому
батько
коміт
43c1d497bc
1 змінених файлів з 3 додано та 1 видалено
  1. 3 1
      gui/wxpython/gui_modules/mapdisp_window.py

+ 3 - 1
gui/wxpython/gui_modules/mapdisp_window.py

@@ -1177,7 +1177,9 @@ class BufferedWindow(MapWindow, wx.Window):
         """!Trac geometry attributes?"""
         """!Trac geometry attributes?"""
         item = self.tree.FindItemByData('maplayer', mapLayer)
         item = self.tree.FindItemByData('maplayer', mapLayer)
         vdigit = self.tree.GetPyData(item)[0]['vdigit']
         vdigit = self.tree.GetPyData(item)[0]['vdigit']
-        if vdigit.has_key('geomAttr') and vdigit['geomAttr'].has_key(attrb):
+        if vdigit and \
+                vdigit.has_key('geomAttr') and \
+                vdigit['geomAttr'].has_key(attrb):
             val = -1
             val = -1
             if attrb == 'length':
             if attrb == 'length':
                 val = digit.GetLineLength(fid)
                 val = digit.GetLineLength(fid)