Update PiggyBankObserver.php

Catch nullpointer.

Signed-off-by: James Cole <james@firefly-iii.org>
This commit is contained in:
James Cole 2024-11-08 09:29:35 +01:00 committed by GitHub
parent 02543438a4
commit deb58e617d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -39,7 +39,7 @@ class PiggyBankObserver
$repetition->startdate = $piggyBank->startdate;
$repetition->startdate_tz = $piggyBank->startdate->format('e');
$repetition->targetdate = $piggyBank->targetdate;
$repetition->targetdate_tz = $piggyBank->targetdate->format('e');
$repetition->targetdate_tz = $piggyBank->targetdate?->format('e');
$repetition->currentamount = '0';
$repetition->save();
}