Skip to content

Commit

Permalink
fix: Add optional chaining to flag check (#4146)
Browse files Browse the repository at this point in the history
  • Loading branch information
DafyddLlyr authored Jan 14, 2025
1 parent 75f7a5d commit a3198bb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -942,7 +942,7 @@ const collectedFlagValuesByCategory = (
if (breadcrumb.answers) {
breadcrumb.answers.forEach((answerId) => {
const node = flow[answerId];
if (node.data?.flags) {
if (node?.data?.flags) {
node.data.flags.forEach((flag: Flag["value"]) => {
if (possibleFlagValues.includes(flag)) collectedFlags.push(flag);
});
Expand Down

0 comments on commit a3198bb

Please sign in to comment.