From 3bf50403242c6f3841fcdd470910d3132c8722bd Mon Sep 17 00:00:00 2001 From: James Cole Date: Thu, 2 Mar 2017 16:42:33 +0100 Subject: [PATCH] Fixed null pointer in debug message [skip ci] --- app/Repositories/Account/AccountTasker.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/Repositories/Account/AccountTasker.php b/app/Repositories/Account/AccountTasker.php index e5c81eb211..e5c4ab1bfb 100644 --- a/app/Repositories/Account/AccountTasker.php +++ b/app/Repositories/Account/AccountTasker.php @@ -127,12 +127,12 @@ class AccountTasker implements AccountTaskerInterface // get first journal date: $first = $repository->oldestJournal($account); - Log::debug(sprintf('Date of first journal for %s is %s', $account->name, $first->date->format('Y-m-d'))); $entry['start_balance'] = $startSet[$account->id] ?? '0'; $entry['end_balance'] = $endSet[$account->id] ?? '0'; // first journal exists, and is on start, then this is the actual opening balance: if (!is_null($first->id) && $first->date->isSameDay($start)) { + Log::debug(sprintf('Date of first journal for %s is %s', $account->name, $first->date->format('Y-m-d'))); $entry['start_balance'] = $first->transactions()->where('account_id', $account->id)->first()->amount; Log::debug(sprintf('Account %s was opened on %s, so opening balance is %f', $account->name, $start->format('Y-m-d'), $entry['start_balance'])); }