Fix null pointer

This commit is contained in:
James Cole
2024-01-05 10:55:46 +01:00
parent 25a23801be
commit f9463e02a2
11 changed files with 23 additions and 3 deletions

View File

@@ -36,6 +36,7 @@ use FireflyIII\Repositories\Journal\JournalRepositoryInterface;
use FireflyIII\User;
use Illuminate\Contracts\Auth\Authenticatable;
use Illuminate\Support\Collection;
use Illuminate\Support\Facades\Log;
/**
* Class PiggyBankRepository.
@@ -48,6 +49,7 @@ class PiggyBankRepository implements PiggyBankRepositoryInterface
public function destroyAll(): void
{
Log::channel('audit')->info('Delete all piggy banks through destroyAll');
$this->user->piggyBanks()->delete();
}