Преглед изворни кода

wxGUI: don't cast code if empty
(merge from devbr6, https://trac.osgeo.org/grass/changeset/38285)


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

Martin Landa пре 16 година
родитељ
комит
85760a37f3
1 измењених фајлова са 4 додато и 1 уклоњено
  1. 4 1
      gui/wxpython/gui_modules/preferences.py

+ 4 - 1
gui/wxpython/gui_modules/preferences.py

@@ -1654,7 +1654,10 @@ class PreferencesDialog(wx.Dialog):
         choices = map(str, self.epsgCodeDict.keys())
 
         list.SetItems(choices)
-        code = int(list.GetValue())
+        try:
+            code = int(list.GetValue())
+        except ValueError:
+            code = -1
         win = self.FindWindowById(self.winId['projection:statusbar:proj4'])
         if self.epsgCodeDict.has_key(code):
             win.SetValue(self.epsgCodeDict[code][1])