From f674df44225efdc12ad1acbee1e8c63e72177d00 Mon Sep 17 00:00:00 2001 From: James Cole Date: Sun, 11 Feb 2018 20:45:48 +0100 Subject: [PATCH] Fix empty title. --- routes/breadcrumbs.php | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/routes/breadcrumbs.php b/routes/breadcrumbs.php index 15b91f1d13..b95db6f8a6 100644 --- a/routes/breadcrumbs.php +++ b/routes/breadcrumbs.php @@ -81,13 +81,14 @@ Breadcrumbs::register( $breadcrumbs->parent('accounts.index', $what); $breadcrumbs->push($account->name, route('accounts.show', [$account->id])); - - $title = trans( - 'firefly.between_dates_breadcrumb', - ['start' => $start ? $start->formatLocalized(strval(trans('config.month_and_day'))) : '', - 'end' => $end ? $end->formatLocalized(strval(trans('config.month_and_day'))) : '',] - ); - $breadcrumbs->push($title, route('accounts.show', $account)); + if (!is_null($start) && !is_null($end)) { + $title = trans( + 'firefly.between_dates_breadcrumb', + ['start' => $start ? $start->formatLocalized(strval(trans('config.month_and_day'))) : '', + 'end' => $end ? $end->formatLocalized(strval(trans('config.month_and_day'))) : '',] + ); + $breadcrumbs->push($title, route('accounts.show', $account)); + } } );