Skip to content

Firefly III: a personal finances manager

Fixes the tests.

James Cole119930399afa
diff --git a/app/controllers/BaseController.php b/app/controllers/BaseController.php
index 69243c88a4..2fbda0cb97 100644
--- a/app/controllers/BaseController.php
+++ b/app/controllers/BaseController.php
@@ -10,7 +10,6 @@ class BaseController extends Controller
*
*/
public function __construct() {
- parent::__construct();
Event::fire('limits.check');
}
/**
diff --git a/app/lib/Firefly/Trigger/Limits/EloquentLimitTrigger.php b/app/lib/Firefly/Trigger/Limits/EloquentLimitTrigger.php
index b16c472480..feeac60173 100644
--- a/app/lib/Firefly/Trigger/Limits/EloquentLimitTrigger.php
+++ b/app/lib/Firefly/Trigger/Limits/EloquentLimitTrigger.php
@@ -19,10 +19,14 @@ class EloquentLimitTrigger
*/
public function checkRepeatingLimits()
{
- $limits = \Limit::leftJoin('components', 'components.id', '=', 'limits.component_id')
- ->where('components.user_id', \Auth::user()->id)
- ->where('limits.repeats', 1)
- ->get(['limits.*']);
+ if (\Auth::check()) {
+ $limits = \Limit::leftJoin('components', 'components.id', '=', 'limits.component_id')
+ ->where('components.user_id', \Auth::user()->id)
+ ->where('limits.repeats', 1)
+ ->get(['limits.*']);
+ } else {
+ $limits = [];
+ }
/** @var \Limit $limit */
foreach ($limits as $limit) {