From a7ef75a417d0f67d2d47f9f978c5f4f7ee40dd80 Mon Sep 17 00:00:00 2001 From: Ruben Fiszel Date: Mon, 11 Nov 2024 17:48:09 +0100 Subject: [PATCH] nit toast --- frontend/src/lib/components/toast.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/frontend/src/lib/components/toast.ts b/frontend/src/lib/components/toast.ts index 8c1afb1a31..f1f1a84f19 100644 --- a/frontend/src/lib/components/toast.ts +++ b/frontend/src/lib/components/toast.ts @@ -1,8 +1,8 @@ //regex that match path starting with u/ or f/ and with at least 2 / const pathRegex = /\b(u|f)\/[^\/\s]+\/[^\/\s]+\b/g -export function processMessage(message: string): string { - return message.replaceAll(pathRegex, (path) => { +export function processMessage(message: string | undefined): string { + return (message ?? 'Error without message').replaceAll(pathRegex, (path) => { return `${path}` }) }