Bug 800329 - Check for value before checking its contents. r=ted, a=lsblakk
authorAxel Hecht <l10n@mozilla.com>
Sat, 13 Oct 2012 04:37:15 -0400
changeset 113411 1796bbed02993f62de0ea37e147883e74640088f
parent 113410 6b33ce9ec54853458e74f4d9ff7bf3b4aef7c9e4
child 113412 6f1d02bdf889aa0b32f19654d5f0567ca53b93c2
push id2342
push userryanvm@gmail.com
push dateWed, 17 Oct 2012 00:45:56 +0000
treeherdermozilla-aurora@cbfef8616b63 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, lsblakk
bugs800329
milestone18.0a2
Bug 800329 - Check for value before checking its contents. r=ted, a=lsblakk
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 $