Skip to content

Commit 861aef4

Browse files
committed
Fix warning
1 parent 8120157 commit 861aef4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/contacts/ContactInputs.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,10 @@ const ContactPersonalInformationInputs = () => {
129129
if (first_name || last_name || !email) return;
130130
const [first, last] = email.split('@')[0].split('.');
131131
setValue('first_name', first.charAt(0).toUpperCase() + first.slice(1));
132-
setValue('last_name', last.charAt(0).toUpperCase() + last.slice(1));
132+
setValue(
133+
'last_name',
134+
last ? last.charAt(0).toUpperCase() + last.slice(1) : ''
135+
);
133136
};
134137

135138
const handleEmailPaste: React.ClipboardEventHandler<HTMLDivElement> = e => {

0 commit comments

Comments
 (0)