diff --git a/.flowconfig b/.flowconfig index e36f404424..955444c1c0 100644 --- a/.flowconfig +++ b/.flowconfig @@ -8,3 +8,4 @@ [options] suppress_comment= \\(.\\|\n\\)*\\@flow-disable-next +esproposal.optional_chaining=enable diff --git a/src/Controllers/DatabaseController.js b/src/Controllers/DatabaseController.js index 3aa4da160e..e3ac5723ab 100644 --- a/src/Controllers/DatabaseController.js +++ b/src/Controllers/DatabaseController.js @@ -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) {