Skip to content

Commit

Permalink
fixed Uncaught TypeError: a.replace is not a function
Browse files Browse the repository at this point in the history
#314

tested...
  • Loading branch information
vedmack committed May 14, 2016
1 parent 924dfdf commit 430cddd
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions jquery.dataTables.yadcf.js
Expand Up @@ -2045,15 +2045,18 @@ var yadcf = (function ($) {
aN,
bN;

if (typeof a === 'object' && typeof a.label === 'string') {
a = a.label;
}
if (typeof b === 'object' && typeof b.label === 'string') {
b = b.label;
}

if (typeof a === 'string') {
aA = a.replace(reA, '');
} else if (typeof a === 'object' && typeof a.label === 'string') {
aA = a.label.replace(reA, '');
}
if (typeof b === 'string') {
bA = b.replace(reA, '');
} else if (typeof b === 'object' && typeof b.label === 'string') {
bA = b.label.replace(reA, '');
}

if (aA === bA) {
Expand Down

0 comments on commit 430cddd

Please sign in to comment.