mirror of
https://github.com/Mottie/tablesorter.git
synced 2024-11-15 23:54:22 +00:00
Check if cell have parser to catch undefined error
If you have a table with more table rows than header rows, or use colspan in the table head then it will fail to find a parser, giving us a runtime error.
This commit is contained in:
parent
694357cd2e
commit
3a8666f0b6
@ -296,6 +296,12 @@
|
||||
}
|
||||
tc.cache[k].row.push(c);
|
||||
for (j = 0; j < totalCells; ++j) {
|
||||
if (typeof parsers[j] === 'undefined') {
|
||||
if (tc.debug) {
|
||||
log('No parser found for cell:', c[0].cells[j], 'does it have a header?');
|
||||
}
|
||||
continue;
|
||||
}
|
||||
t = getElementText(table, c[0].cells[j], j);
|
||||
// allow parsing if the string is empty, previously parsing would change it to zero,
|
||||
// in case the parser needs to extract data from the table cell attributes
|
||||
|
Loading…
Reference in New Issue
Block a user