diff --git a/app/frontend/src/javascript/components/payment/payzen/payzen-keys-form.tsx b/app/frontend/src/javascript/components/payment/payzen/payzen-keys-form.tsx index 82a1a3c74..a564bba56 100644 --- a/app/frontend/src/javascript/components/payment/payzen/payzen-keys-form.tsx +++ b/app/frontend/src/javascript/components/payment/payzen/payzen-keys-form.tsx @@ -71,6 +71,8 @@ const PayZenKeysFormComponent: React.FC = ({ onValidKeys }) * Depending on the test result, assign an add-on icon and a style to notify the user. */ const testPublicKey = (key: string) => { + if (!key) return; + if (!key.match(/^[0-9]+:/)) { setPublicKeyAddOn(); setPublicKeyAddOnClassName('key-invalid');