skip further operations if the value is zero-length

This came to my attention because of a Dark Elves scenario with a 'description=' key that was left blank for the value, crashing wmllint with an index error. More broadly, however, the operations in this section are pointless when there is no value.
This commit is contained in:
Groggy Dice 2013-07-10 13:12:02 -04:00
parent 79b8a85a5e
commit 5af7601abd

View file

@ -826,6 +826,8 @@ def sanity_check(filename, lines):
(key, prefix, value, comment) = parse_attribute(lines[i])
if "wmllint: ignore" in comment:
continue
if len(value) == 0:
continue
has_tr_mark = value.lstrip().startswith("_")
if key == 'role':
present.append(value)