Skip to content

Commit

Permalink
Bugfix for filter failing on undefined names
Browse files Browse the repository at this point in the history
  • Loading branch information
fabian-marquardt committed Jun 14, 2017
1 parent 994acc5 commit 1f3c3fc
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/app/components/product-list.component.ts
Expand Up @@ -26,7 +26,7 @@ export class ProductListComponent implements OnInit{
this.filteredProducts = [];

for(let product of this.products) {
if(product.name.toLowerCase().includes(this._filter.toLowerCase())) {
if(product.name && product.name.toLowerCase().includes(this._filter.toLowerCase())) {
this.filteredProducts.push(product);
continue;
}
Expand Down
2 changes: 1 addition & 1 deletion src/app/components/user-list.component.ts
Expand Up @@ -27,7 +27,7 @@ export class UserListComponent implements OnInit{
this.filteredUsers = [];

for(let user of this.users) {
if(user.name.toLowerCase().includes(this._filter.toLowerCase())) {
if(user.name && user.name.toLowerCase().includes(this._filter.toLowerCase())) {
this.filteredUsers.push(user);
continue;
}
Expand Down

0 comments on commit 1f3c3fc

Please sign in to comment.