Skip to content

Commit

Permalink
ensure params.filter present before accessing object keys
Browse files Browse the repository at this point in the history
  • Loading branch information
maxschridde1494 committed Oct 2, 2019
1 parent 09c6f74 commit fb5bf3e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ra-data-graphql-simple/src/buildVariables.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ const buildGetListVariables = introspectionResults => (
aorFetchType,
params
) => {
const filter = Object.keys(params.filter).reduce((acc, key) => {
const filter = params.filter ? Object.keys(params.filter).reduce((acc, key) => {
if (key === 'ids') {
return { ...acc, ids: params.filter[key] };
}
Expand Down Expand Up @@ -174,7 +174,7 @@ const buildGetListVariables = introspectionResults => (
}

return { ...acc, [key]: params.filter[key] };
}, {});
}, {}) : {};

return {
page: parseInt(params.pagination.page, 10) - 1,
Expand Down

0 comments on commit fb5bf3e

Please sign in to comment.