mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-12-11 13:51:21 +00:00
fix: nullpointer
This commit is contained in:
@@ -493,7 +493,8 @@ trait TransactionValidation
|
|||||||
}
|
}
|
||||||
/** @var TransactionJournal $journal */
|
/** @var TransactionJournal $journal */
|
||||||
foreach ($transactionGroup->transactionJournals as $journal) {
|
foreach ($transactionGroup->transactionJournals as $journal) {
|
||||||
if ((int)$journal->id === (int)$transaction['transaction_journal_id']) {
|
$journalId = (int)($transaction['transaction_journal_id'] ?? 0);
|
||||||
|
if ((int)$journal->id === $journalId) {
|
||||||
return $journal->transactions()->where('amount', '<', 0)->first()->account;
|
return $journal->transactions()->where('amount', '<', 0)->first()->account;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -783,8 +784,8 @@ trait TransactionValidation
|
|||||||
private function compareAccountData(string $type, array $comparison): bool
|
private function compareAccountData(string $type, array $comparison): bool
|
||||||
{
|
{
|
||||||
return match ($type) {
|
return match ($type) {
|
||||||
default => $this->compareAccountDataWithdrawal($comparison),
|
default => $this->compareAccountDataWithdrawal($comparison),
|
||||||
'deposit' => $this->compareAccountDataDeposit($comparison),
|
'deposit' => $this->compareAccountDataDeposit($comparison),
|
||||||
'transfer' => $this->compareAccountDataTransfer($comparison),
|
'transfer' => $this->compareAccountDataTransfer($comparison),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user