Skip to content

Commit

Permalink
Avoid treating null-values as objects with keys
Browse files Browse the repository at this point in the history
  • Loading branch information
stensrud committed May 18, 2020
1 parent 0e81f4f commit 7adb91f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/ra-data-graphql-simple/src/getResponseParser.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ const sanitizeResource = data => {
}

if (Array.isArray(dataKey)) {
if (typeof dataKey[0] === 'object') {
if (typeof dataKey[0] === 'object' && dataKey[0] !== null) {
return {
...acc,
[key]: dataKey.map(sanitizeResource),
Expand All @@ -24,7 +24,7 @@ const sanitizeResource = data => {
}
}

if (typeof dataKey === 'object') {
if (typeof dataKey === 'object' && dataKey !== null) {
return {
...acc,
...(dataKey &&
Expand Down

0 comments on commit 7adb91f

Please sign in to comment.