Skip to content

Commit

Permalink
fix(graphql): make sure column exist before trying to get properties
Browse files Browse the repository at this point in the history
  • Loading branch information
ghiscoding committed Mar 30, 2018
1 parent 7ce538a commit 7122d6a
Showing 1 changed file with 6 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -451,10 +451,12 @@ export class GraphqlService implements BackendService {
// display the correct sorting icons on the UI, for that it requires (columnId, sortAsc) properties
const tmpSorterArray = currentSorters.map((sorter) => {
const columnDef = this._columnDefinitions.find((column: Column) => column.id === sorter.columnId);
graphqlSorters.push({
field: (columnDef.queryField || columnDef.queryFieldSorter || columnDef.field || columnDef.id) + '',
direction: sorter.direction
});
if (columnDef) {
graphqlSorters.push({
field: (columnDef.queryField || columnDef.queryFieldSorter || columnDef.field || columnDef.id) + '',
direction: sorter.direction
});
}
return {
columnId: sorter.columnId,
sortAsc: sorter.direction.toUpperCase() === SortDirection.ASC
Expand Down

0 comments on commit 7122d6a

Please sign in to comment.