Bläddra i källkod

wxGUI/dbmgr: fix string handling (quotes)
(merge https://trac.osgeo.org/grass/changeset/68230 from trunk)


git-svn-id: https://svn.osgeo.org/grass/grass/branches/releasebranch_7_0@68231 15284696-431f-4ddb-bdfa-cd5b030d7da7

Martin Landa 9 år sedan
förälder
incheckning
cfa96c13b4
1 ändrade filer med 6 tillägg och 5 borttagningar
  1. 6 5
      gui/wxpython/dbmgr/base.py

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

@@ -1840,11 +1840,12 @@ class DbMgrBrowsePage(DbMgrNotebookBase):
             if self.dbMgrData['mapDBInfo'].tables[table][whereCol]['ctype'] == str:
                 # string attribute, check for quotes
                 whereVal = whereVal.replace('"', "'")
-                if not whereVal.startswith("'"):
-                    whereVal = "'" + whereVal
-                if not whereVal.endswith("'"):
-                    whereVal += "'"
-                whereWin.SetValue(whereVal)
+                if whereVal:
+                    if not whereVal.startswith("'"):
+                        whereVal = "'" + whereVal
+                    if not whereVal.endswith("'"):
+                        whereVal += "'"
+                    whereWin.SetValue(whereVal)
             
             try:
                 if len(whereVal) > 0: