Update configuration and fix some files.

This commit is contained in:
James Cole
2025-05-27 17:02:18 +02:00
parent c074fec0a7
commit d8f512ca3a
31 changed files with 154 additions and 111 deletions

View File

@@ -75,7 +75,7 @@ class AccountFactory
app('log')->debug(sprintf('findOrCreate("%s", "%s")', $accountName, $accountType));
$type = $this->accountRepository->getAccountTypeByType($accountType);
if (null === $type) {
if (!$type instanceof AccountType) {
throw new FireflyException(sprintf('Cannot find account type "%s"', $accountType));
}
$return = $this->user->accounts->where('account_type_id', $type->id)->where('name', $accountName)->first();
@@ -111,7 +111,7 @@ class AccountFactory
// account may exist already:
$return = $this->find($data['name'], $type->type);
if (null !== $return) {
if ($return instanceof Account) {
return $return;
}