From b5672d676fd2aebbe7b2539febfa8ebb424b531d Mon Sep 17 00:00:00 2001 From: Sam Rose Date: Mon, 29 Jan 2024 17:38:52 +0000 Subject: [PATCH] Add a check to stringSplit that gives a nicer error message is a non-string is passed. --- packages/server/src/automations/automationUtils.ts | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/server/src/automations/automationUtils.ts b/packages/server/src/automations/automationUtils.ts index 3e25665a60..8f63b1d0dd 100644 --- a/packages/server/src/automations/automationUtils.ts +++ b/packages/server/src/automations/automationUtils.ts @@ -131,6 +131,9 @@ export function stringSplit(value: string | string[]) { if (value == null || Array.isArray(value)) { return value || [] } + if (typeof value !== "string") { + throw new Error(`Unable to split value of type ${typeof value}: ${value}`) + } if (value.split("\n").length > 1) { value = value.split("\n") } else {