Skip to content

Commit

Permalink
fix(filter): throw descriptive error #4897
Browse files Browse the repository at this point in the history
  • Loading branch information
tachojelev committed May 28, 2019
1 parent 6f2fd72 commit 58f720d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 3 additions & 0 deletions projects/igniteui-angular/src/lib/grids/api.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -326,6 +326,9 @@ export class GridBaseAPIService <T extends IgxGridBaseComponent & IGridDataBinda
}

grid.filteringExpressionsTree = filteringTree;
if (!condition) {
throw Error('Invalid condition!');
}
}

public clear_filter(fieldName: string) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,9 @@ export class IgxFilteringService implements OnDestroy {
this.gridAPI.filter(field, value, conditionOrExpressionTree, filteringIgnoreCase);
} else {
const expressionsTreeForColumn = this.grid.filteringExpressionsTree.find(field);
if (expressionsTreeForColumn instanceof FilteringExpressionsTree) {
if (!expressionsTreeForColumn) {
throw Error('Invalid condition or Expression Tree!');
} else if (expressionsTreeForColumn instanceof FilteringExpressionsTree) {
this.gridAPI.filter(field, value, expressionsTreeForColumn, filteringIgnoreCase);
} else {
const expressionForColumn = expressionsTreeForColumn as IFilteringExpression;
Expand Down

0 comments on commit 58f720d

Please sign in to comment.