diff --git a/src/express/responses/formatError.js b/src/express/responses/formatError.js index 9ca60ef5b5..24850044bd 100644 --- a/src/express/responses/formatError.js +++ b/src/express/responses/formatError.js @@ -1,6 +1,6 @@ const formatErrorResponse = (incoming) => { if (incoming) { - if (incoming?.data?.length > 0) { + if (incoming && incoming.data && incoming.data.length > 0) { return { errors: [{ name: incoming.name,