Firefly III: a personal finances manager
PHP accountingbudgetbudgetingbudgetscash-flowcashflowcredit-carddockerexpensesfinancefinancesfinanciallinuxmoneypaycheckpersonal-financephpphp7
Fix #1353
James Cole6f0e1c79aca1
diff --git a/app/Http/Middleware/Range.php b/app/Http/Middleware/Range.phpindex 2df70e8f2b..e8e1a1136a 100644--- a/app/Http/Middleware/Range.php+++ b/app/Http/Middleware/Range.php@@ -122,9 +122,13 @@ class Range// ignore preference. set the range to be the current month:if (!Session::has('start') && !Session::has('end')) {$viewRange = Preferences::get('viewRange', '1M')->data;- $start = new Carbon;- $start = app('navigation')->updateStartDate($viewRange, $start);- $end = app('navigation')->updateEndDate($viewRange, $start);+ if (null === $viewRange) {+ $viewRange = '1M';+ Preferences::set('viewRange', '1M');+ }+ $start = new Carbon;+ $start = app('navigation')->updateStartDate($viewRange, $start);+ $end = app('navigation')->updateEndDate($viewRange, $start);Session::put('start', $start);Session::put('end', $end);@@ -132,10 +136,10 @@ class Rangeif (!Session::has('first')) {/** @var JournalRepositoryInterface $repository */$repository = app(JournalRepositoryInterface::class);- $journal = $repository->first();+ $journal = $repository->firstNull();$first = Carbon::now()->startOfYear();- if (null !== $journal->id) {+ if (null !== $journal) {$first = $journal->date;}Session::put('first', $first);