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 109567 c9f397f91cce5888ce4ddb846e8f68f126e31d1b
parent 109566 b764d990ccad868a73a4076b8627cf1f32d1b6cf
child 109568 10bd7a864ae2faae821f91706ccbce600e95c9e7
push id1542
push userMs2ger@gmail.com
push dateTue, 16 Oct 2012 14:47:30 +0000
treeherdermozilla-beta@c9f397f91cce [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersted, lsblakk
bugs800329
milestone17.0
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 $