Browse code

Fix traceback in template error detection code

Fixes #5081

James Cammarata authored on 2013/11/29 23:47:03
Showing 1 changed files
... ...
@@ -102,7 +102,7 @@ def _legacy_varFindLimitSpace(basedir, vars, space, part, lookup_fatal, depth, e
102 102
     if space is None:
103 103
         return space
104 104
     # A part with escaped .s in it is compounded by { and }, remove them
105
-    if part[0] == '{' and part[-1] == '}':
105
+    if len(part) > 0 and part[0] == '{' and part[-1] == '}':
106 106
         part = part[1:-1]
107 107
     # Template part to resolve variables within (${var$var2})
108 108
     part = legacy_varReplace(basedir, part, vars, lookup_fatal=lookup_fatal, depth=depth + 1, expand_lists=expand_lists)