mirror of
https://github.com/firefly-iii/firefly-iii.git
synced 2024-11-21 16:38:36 -06:00
Catch potential nullpointers
This commit is contained in:
parent
068094caac
commit
b4edd3dcc4
@ -377,11 +377,11 @@ trait ModifiesPiggyBanks
|
||||
}
|
||||
if (array_key_exists('targetdate', $data) && '' !== $data['targetdate']) {
|
||||
$piggyBank->targetdate = $data['targetdate'];
|
||||
$piggyBank->targetdate_tz = $data['targetdate']->format('e');
|
||||
$piggyBank->targetdate_tz = $data['targetdate']?->format('e');
|
||||
}
|
||||
if (array_key_exists('startdate', $data)) {
|
||||
$piggyBank->startdate = $data['startdate'];
|
||||
$piggyBank->startdate_tz = $data['targetdate']->format('e');
|
||||
$piggyBank->startdate_tz = $data['targetdate']?->format('e');
|
||||
}
|
||||
$piggyBank->save();
|
||||
|
||||
|
@ -236,12 +236,12 @@ class AccountBalanceCalculator
|
||||
'balance' => '0',
|
||||
'transaction_currency_id' => $currencyId,
|
||||
'date' => $balance[1],
|
||||
'date_tz' => $balance[1]->format('e'),
|
||||
'date_tz' => $balance[1]?->format('e'),
|
||||
]
|
||||
);
|
||||
$object->balance = $balance[0];
|
||||
$object->date = $balance[1];
|
||||
$object->date_tz = $balance[1]->format('e');
|
||||
$object->date_tz = $balance[1]?->format('e');
|
||||
$object->save();
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user