Skip to content

A full-featured CRM built with React, shadcn/ui, and Supabase.

Fix warning

François Zaninotto861aef4c2f98
diff --git a/src/contacts/ContactInputs.tsx b/src/contacts/ContactInputs.tsx
index 03ace315..d327fc96 100644
--- a/src/contacts/ContactInputs.tsx
+++ b/src/contacts/ContactInputs.tsx
@@ -129,7 +129,10 @@ const ContactPersonalInformationInputs = () => {
if (first_name || last_name || !email) return;
const [first, last] = email.split('@')[0].split('.');
setValue('first_name', first.charAt(0).toUpperCase() + first.slice(1));
- setValue('last_name', last.charAt(0).toUpperCase() + last.slice(1));
+ setValue(
+ 'last_name',
+ last ? last.charAt(0).toUpperCase() + last.slice(1) : ''
+ );
};
const handleEmailPaste: React.ClipboardEventHandler<HTMLDivElement> = e => {