Skip to content

Commit

Permalink
Merge pull request #976 from navikt/bugfix/validateAccountNumber-fix
Browse files Browse the repository at this point in the history
input no longer return empty string, need to support null also
  • Loading branch information
lotorvik authored Jan 19, 2024
2 parents cd33216 + 944c2bf commit 31e79b5
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Component } from '@navikt/skjemadigitalisering-shared-domain';
const editFormCustomMessage = (): Component => {
return {
key: 'validate.customMessage',
label: 'Custom Error Message',
label: 'Egen feilmelding',
type: 'textfield',
input: true,
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ class AccountNumber extends TextField {
}

validateAccountNumber(accountNumber) {
if (accountNumber === '') {
if (accountNumber === '' || accountNumber === null) {
return true;
}
return validatorUtils.isAccountNumber(accountNumber + '');
Expand Down

0 comments on commit 31e79b5

Please sign in to comment.