Bug 800329 - Check for value before checking its contents. r=ted
authorAxel Hecht <l10n@mozilla.com>
Sat, 13 Oct 2012 04:37:15 -0400
changeset 110136 057589f16a3acda5898755666999df67bc9f7a37
parent 110135 eaffa9d2341ea5b92c68951d8cda4cb1004b0bbd
child 110137 d0f744425ce0d42b765dd92a9df4df6a52ddc8ad
push id23674
push userryanvm@gmail.com
push dateSat, 13 Oct 2012 23:26:43 +0000
treeherdermozilla-central@d750d39139d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted
bugs800329
milestone19.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 800329 - Check for value before checking its contents. r=ted
toolkit/mozapps/installer/windows/nsis/preprocess-locale.py
--- a/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py
+++ b/toolkit/mozapps/installer/windows/nsis/preprocess-locale.py
@@ -40,17 +40,17 @@ def get_locale_strings(path, prefix, mid
     fp = open(path, "r")
     for line in fp:
         line = line.strip()
         if line == "" or line[0] == "#":
             continue
 
         name, value = line.split("=", 1)
         value = value.strip() # trim whitespace from the start and end
-        if value[-1] == "\"" and value[0] == "\"":
+        if value and value[-1] == "\"" and value[0] == "\"":
             value = value[1:-1] # remove " from the start and end
 
         if add_cr:
             value = value.replace("\\n", "\\r\\n") # prefix $\n with $\r
             value = value.replace("\\r\\r", "\\r") # replace $\r$\r with $\r
 
         value = value.replace("\"", "$\\\"") # prefix " with $\
         value = value.replace("\\r", "$\\r") # prefix \r with $