Fix nullpointer.

This commit is contained in:
James Cole 2022-01-07 19:24:14 +01:00
parent 867a2eacd3
commit a9e92d4fa6
No known key found for this signature in database
GPG Key ID: BDE6667570EADBD5

View File

@ -221,7 +221,7 @@ class AccountValidator
}
// find by iban
if (null !== $accountIban && '' !== $accountIban) {
if (null !== $accountIban && '' !== (string) $accountIban) {
$first = $this->accountRepository->findByIbanNull($accountIban, $validTypes);
if ((null !== $first) && in_array($first->accountType->type, $validTypes, true)) {
return $first;
@ -229,7 +229,7 @@ class AccountValidator
}
// find by number
if (null !== $accountNumber && '' !== $accountNumber) {
if (null !== $accountNumber && '' !== (string) $accountNumber) {
$first = $this->accountRepository->findByAccountNumber($accountNumber, $validTypes);
if ((null !== $first) && in_array($first->accountType->type, $validTypes, true)) {
return $first;
@ -237,7 +237,7 @@ class AccountValidator
}
// find by name:
if ('' !== $accountName) {
if ('' !== (string) $accountName) {
return $this->accountRepository->findByName($accountName, $validTypes);
}