Skip to content

Commit 6db45ae

Browse files
committed
Fix fatal error when evaluateCondition is called before the router populates current route information
1 parent d9ee774 commit 6db45ae

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

CHANGELOG.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@
22

33
## v0.3.1.19
44

5-
- Fixed some minor error screen layout issues
5+
- Fix some minor error screen layout issues
66
- Make User::fresh() compatible with Eloquent\Model v5.2.40+
77
- Update composer require to allow for Fortress 1.x bugfixes
88
- Allow database port definitions in config-userfrosting.php
9+
- Fix fatal error when evaluateCondition is called before the router populates current route information
910

1011
## v0.3.1.18
1112

userfrosting/models/auth/AccessConditionExpression.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public function evaluateCondition($condition, $params){
6767
$params['self'] = $this->_app->user->export();
6868

6969
$route = $this->_app->router()->getCurrentRoute();
70-
$params['route'] = $route->getParams();
70+
$params['route'] = (is_null($route) ? [] : $route->getParams());
7171

7272
/* Traverse the parse tree, and execute all function calls as methods of class AccessCondition.
7373
Replace the function node with the return value of the method.

0 commit comments

Comments
 (0)