mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2025-10-12 15:35:15 +00:00
Fix issue when DB is empty.
This commit is contained in:
@@ -55,6 +55,9 @@ class RemoveBills extends Command
|
||||
$start = microtime(true);
|
||||
/** @var TransactionType $withdrawal */
|
||||
$withdrawal = TransactionType::where('type', TransactionType::WITHDRAWAL)->first();
|
||||
if(null === $withdrawal) {
|
||||
return 0;
|
||||
}
|
||||
$journals = TransactionJournal::whereNotNull('bill_id')->where('transaction_type_id', '!=', $withdrawal->id)->get();
|
||||
/** @var TransactionJournal $journal */
|
||||
foreach ($journals as $journal) {
|
||||
|
Reference in New Issue
Block a user