fix for bug reported by David Guimaraes (colEntry = entry[index] - IndexError: list index out of range)

This commit is contained in:
Miroslav Stampar 2010-09-01 09:25:21 +00:00
parent 27d76847fe
commit 18db96c45f

View File

@ -1061,10 +1061,13 @@ class Enumeration:
kb.data.dumpedTable[column] = { "length": 0, "values": [] } kb.data.dumpedTable[column] = { "length": 0, "values": [] }
for entry in entries: for entry in entries:
if entry is None or len(entry) == 0:
continue
if isinstance(entry, basestring): if isinstance(entry, basestring):
colEntry = entry colEntry = entry
else: else:
colEntry = entry[index] colEntry = entry[index] if index < len(entry) else u''
colEntryLen = len(getUnicode(colEntry)) colEntryLen = len(getUnicode(colEntry))
maxLen = max(colLen, colEntryLen) maxLen = max(colLen, colEntryLen)