[7.2] Fix: handle null argument values (#37411) (#37416)

typeof null === 'object', so add an explicit check for null
This commit is contained in:
Joe Fleming 2019-05-29 14:53:52 -07:00 committed by GitHub
parent 9c80725d98
commit 7253136e08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -160,7 +160,7 @@ function extractFilterGroups(ast) {
return groups.concat(
buildGroupValues(args, argValue => {
// this only handles simple values
if (typeof argValue !== 'object') {
if (argValue !== null && typeof argValue !== 'object') {
return argValue;
}
})
@ -170,7 +170,7 @@ function extractFilterGroups(ast) {
return groups.concat(
buildGroupValues(args, argValue => {
// recursively collect filter groups
if (typeof argValue === 'object' && argValue.type === 'expression') {
if (argValue !== null && typeof argValue === 'object' && argValue.type === 'expression') {
return extractFilterGroups(argValue);
}
})