Skip to content

Commit

Permalink
fix: (STRF-9294) Added check to ensure we are not looping over undefi…
Browse files Browse the repository at this point in the history
…ned object
  • Loading branch information
jkanive committed Aug 4, 2021
1 parent c735b7e commit bcd2401
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions server/plugins/renderer/renderer.module.js
Original file line number Diff line number Diff line change
Expand Up @@ -237,9 +237,12 @@ internals.parseResponse = async (bcAppData, request, response, responseArgs) =>
}

const formattedRegions = {};
regionResponse.renderedRegions.forEach((region) => {
formattedRegions[region.name] = region.html;
});

if (typeof regionResponse.renderedRegions !== 'undefined') {
regionResponse.renderedRegions.forEach((region) => {
formattedRegions[region.name] = region.html;
});
}

return internals.getPencilResponse(
response2.data,
Expand Down

0 comments on commit bcd2401

Please sign in to comment.