Преглед на файлове

wxGUI: fix error when saving empty map display to graphic file

git-svn-id: https://svn.osgeo.org/grass/grass/trunk@59098 15284696-431f-4ddb-bdfa-cd5b030d7da7
Anna Petrášová преди 11 години
родител
ревизия
f0331c6c97
променени са 1 файла, в които са добавени 5 реда и са изтрити 1 реда
  1. 5 1
      gui/wxpython/mapdisp/frame.py

+ 5 - 1
gui/wxpython/mapdisp/frame.py

@@ -552,6 +552,8 @@ class MapFrame(SingleMapFrame):
         """!Save map to image
         """
         filetype, ltype = self._prepareSaveToFile()
+        if not ltype:
+            return
         
         # get size
         dlg = ImageSizeDialog(self)
@@ -591,6 +593,8 @@ class MapFrame(SingleMapFrame):
         Command is expected to be validated by parser.        
         """
         filetype, ltype = self._prepareSaveToFile()
+        if not ltype:
+            return
         width, height = self.MapWindow.GetClientSize()
         for param in command[1:]:
             p, val = param.split('=')
@@ -640,7 +644,7 @@ class MapFrame(SingleMapFrame):
             if not img:
                 GMessage(parent = self,
                          message = _("Nothing to render (empty map). Operation canceled."))
-                return
+                return None, None
             filetype, ltype = GetImageHandlers(img)
         return filetype, ltype