Skip to content

Firefly III: a personal finances manager

Do not search for empty number.

James Colea58c6b0cec25
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]]);