From a58c6b0cec25726494e5c04a6133fa81579d4b92 Mon Sep 17 00:00:00 2001 From: James Cole Date: Mon, 28 Feb 2022 08:31:58 +0100 Subject: [PATCH] Do not search for empty number. --- app/Services/Internal/Support/JournalServiceTrait.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Services/Internal/Support/JournalServiceTrait.php b/app/Services/Internal/Support/JournalServiceTrait.php index 5ee8e19516..3d60e2add8 100644 --- a/app/Services/Internal/Support/JournalServiceTrait.php +++ b/app/Services/Internal/Support/JournalServiceTrait.php @@ -172,7 +172,7 @@ trait JournalServiceTrait private function findAccountByNumber(?Account $account, array $data, array $types): ?Account { // third attempt, find by account number - if (null === $account && null !== $data['number']) { + if (null === $account && null !== $data['number'] && '' !== (string) $data['number']) { Log::debug(sprintf('Searching for account number "%s".', $data['number'])); // find by preferred type. $source = $this->accountRepository->findByAccountNumber((string)$data['number'], [$types[0]]);