diff --git a/dist/amd/au-table.js b/dist/amd/au-table.js index ec4718b..670879d 100644 --- a/dist/amd/au-table.js +++ b/dist/amd/au-table.js @@ -183,11 +183,14 @@ define(["exports", "aurelia-framework"], function (exports, _aureliaFramework) { var key = _ref2; - var value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key] != null) { + var value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/dist/commonjs/au-table.js b/dist/commonjs/au-table.js index 69e3bcf..727dfa9 100644 --- a/dist/commonjs/au-table.js +++ b/dist/commonjs/au-table.js @@ -180,11 +180,14 @@ var AureliaTableCustomAttribute = exports.AureliaTableCustomAttribute = (_dec = var key = _ref2; - var value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key] != null) { + var value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/dist/es2015/au-table.js b/dist/es2015/au-table.js index 882a1b5..c6e8cd0 100644 --- a/dist/es2015/au-table.js +++ b/dist/es2015/au-table.js @@ -140,11 +140,14 @@ export let AureliaTableCustomAttribute = (_dec = inject(BindingEngine), _dec2 = for (let next of toFilter) { for (let key of this.filterKeys) { - let value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key] != null) { + let value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/dist/system/au-table.js b/dist/system/au-table.js index e81d922..76aca7f 100644 --- a/dist/system/au-table.js +++ b/dist/system/au-table.js @@ -188,11 +188,14 @@ System.register(["aurelia-framework"], function (_export, _context) { var key = _ref2; - var value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if (next[key] != null) { + var value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } } diff --git a/src/au-table.js b/src/au-table.js index 796f997..4124dc8 100644 --- a/src/au-table.js +++ b/src/au-table.js @@ -101,14 +101,17 @@ export class AureliaTableCustomAttribute { doFilter(toFilter) { let filteredData = []; - + for (let next of toFilter) { for (let key of this.filterKeys) { - let value = next[key].toString(); - if (value.toLowerCase().indexOf(this.filterText.toLowerCase()) > -1) { - filteredData.push(next); - break; + if( next[key]!= null ){ + let value = next[key].toString().toLowerCase(); + + if (value.indexOf(this.filterText.toLowerCase()) > -1) { + filteredData.push(next); + break; + } } } }