Skip to content

Firefly III: a personal finances manager

This PHP7 thing is strict!

James Cole9465a6d2b57d
diff --git a/app/Helpers/Collection/BudgetLine.php b/app/Helpers/Collection/BudgetLine.php
index 97d8ca3579..ecda6ac7ca 100644
--- a/app/Helpers/Collection/BudgetLine.php
+++ b/app/Helpers/Collection/BudgetLine.php
@@ -97,7 +97,7 @@ class BudgetLine
*/
public function getRepetition(): LimitRepetition
{
- return $this->repetition;
+ return $this->repetition ?? new LimitRepetition;
}
/**
diff --git a/resources/views/reports/partials/budgets.twig b/resources/views/reports/partials/budgets.twig
index dd9bda2461..19122b4cd7 100644
--- a/resources/views/reports/partials/budgets.twig
+++ b/resources/views/reports/partials/budgets.twig
@@ -26,12 +26,12 @@
{% endif %}
</td>
<td>
- {% if budgetLine.getRepetition %}
+ {% if budgetLine.getRepetition.id %}
<a href="{{ route('budgets.show', [budgetLine.getBudget.id, budgetLine.getRepetition.id]) }}">{{ budgetLine.getRepetition.startdate.formatLocalized(monthAndDayFormat) }}</a>
{% endif %}
</td>
<td>
- {% if budgetLine.getRepetition %}
+ {% if budgetLine.getRepetition.id %}
{{ budgetLine.getRepetition.amount|formatAmount }}
{% else %}
{{ 0|formatAmount }}