Skip to content

Commit

Permalink
Core: prevent js error if sortList targets incorrect column. Fixes #908
Browse files Browse the repository at this point in the history
  • Loading branch information
Mottie committed May 14, 2015
1 parent 6e2750b commit 65d4872
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions js/jquery.tablesorter.js
Original file line number Diff line number Diff line change
Expand Up @@ -639,9 +639,10 @@
val = sortList[indx];
// ensure all sortList values are numeric - fixes #127
col = parseInt(val[0], 10);
// make sure header exists
header = c.$headerIndexed[col][0];
if (header) { // prevents error if sorton array is wrong
// prevents error if sorton array is wrong
if ( col < c.columns && c.$headerIndexed[col] ) {
// make sure header exists
header = c.$headerIndexed[col][0];
// o.count = o.count + 1;
dir = ('' + val[1]).match(/^(1|d|s|o|n)/);
dir = dir ? dir[0] : '';
Expand Down

0 comments on commit 65d4872

Please sign in to comment.