From 7adb91f0a0234f458ba54c1a13597d118af078b8 Mon Sep 17 00:00:00 2001 From: Jon Helge Stensrud Date: Mon, 18 May 2020 17:34:03 +0200 Subject: [PATCH] Avoid treating null-values as objects with keys --- packages/ra-data-graphql-simple/src/getResponseParser.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/ra-data-graphql-simple/src/getResponseParser.js b/packages/ra-data-graphql-simple/src/getResponseParser.js index 1abb3ee2993..3f598c7c3d3 100644 --- a/packages/ra-data-graphql-simple/src/getResponseParser.js +++ b/packages/ra-data-graphql-simple/src/getResponseParser.js @@ -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), @@ -24,7 +24,7 @@ const sanitizeResource = data => { } } - if (typeof dataKey === 'object') { + if (typeof dataKey === 'object' && dataKey !== null) { return { ...acc, ...(dataKey &&