diff --git a/packages/lib/slugify.ts b/packages/lib/slugify.ts index e43d8d57e3..3ace3c9d0e 100644 --- a/packages/lib/slugify.ts +++ b/packages/lib/slugify.ts @@ -2,6 +2,9 @@ // For eg:- "test-slug" is the slug user wants to set but while typing "test-" would get replace to "test" becauser of replace(/-+$/, "") export const slugify = (str: string, forDisplayingInput?: boolean) => { + if (!str) { + return ""; + } const s = str .toLowerCase() // Convert to lowercase .trim() // Remove whitespace from both sides