From dc937a0960840bdc62678ed52207ccb41dda6e47 Mon Sep 17 00:00:00 2001 From: Jessica McInchak Date: Mon, 2 Dec 2024 15:45:19 +0100 Subject: [PATCH] fix: `TypeError: R.startsWith is not a function` in `computePassport` (#4026) --- editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts index 3a86b50f7e..ef3a4f164c 100644 --- a/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts +++ b/editor.planx.uk/src/pages/FlowEditor/lib/store/preview.ts @@ -226,7 +226,7 @@ export const previewStore: StateCreator< .concat(existingValue) .reduce( (acc: string[], curr: string, _i: number, arr: string[]) => { - if (!arr.some((x) => x !== curr && x.startsWith(curr))) { + if (!arr.some((x) => x !== curr && x?.startsWith(curr))) { acc.push(curr); } return acc;