fix: Schema without class level permissions may cause error (#8409)

This commit is contained in:
Diamond Lewis
2023-01-27 10:57:50 -06:00
committed by GitHub
parent cf6966fa10
commit aa2cd51b70
2 changed files with 3 additions and 4 deletions

View File

@@ -8,3 +8,4 @@
[options]
suppress_comment= \\(.\\|\n\\)*\\@flow-disable-next
esproposal.optional_chaining=enable

View File

@@ -220,10 +220,8 @@ const filterSensitiveData = (
protectedFields && protectedFields.forEach(k => delete object[k]);
// fields not requested by client (excluded),
//but were needed to apply protecttedFields
perms.protectedFields &&
perms.protectedFields.temporaryKeys &&
perms.protectedFields.temporaryKeys.forEach(k => delete object[k]);
// but were needed to apply protectedFields
perms?.protectedFields?.temporaryKeys?.forEach(k => delete object[k]);
}
for (const key in object) {