Skip to content

Commit 51635c4

Browse files
committed
check recaptchref
1 parent d42029b commit 51635c4

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

components/mailchimp/NewsletterForm.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,10 @@ const NewsletterForm = ({ status, message, onValidated }) => {
3838
console.log(error?.message || 'Something went wrong');
3939
} finally {
4040
// Reset the reCAPTCHA when the request has failed or succeeded
41-
recaptchaRef.current.reset();
41+
if (recaptchaRef?.current) {
42+
recaptchaRef.current.reset();
43+
}
44+
4245
setEmail('');
4346
setName('');
4447
}

0 commit comments

Comments
 (0)