Skip to content

Commit

Permalink
Fixed Trying to get property 'username' of non-object error in Flex
Browse files Browse the repository at this point in the history
  • Loading branch information
mahagr committed Jun 26, 2020
1 parent 7826608 commit 60316d1
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
1. [](#bugfix)
* Fixed `MediaUploadTrait::copyUploadedFile()` not adding uploaded media to the collection
* Fixed regression in saving media to a new Flex Object
* Fixed `Trying to get property 'username' of non-object` error in Flex [flex-objects#62](https://github.com/trilbymedia/grav-plugin-flex-objects/issues/62)

# v1.7.0-rc.12
## 06/08/2020
Expand Down
2 changes: 1 addition & 1 deletion system/src/Grav/Framework/Flex/FlexIndex.php
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,7 @@ public function __call($name, $arguments)
if ($type === 'session') {
/** @var Session $session */
$session = Grav::instance()['session'];
$cacheKey = $session->getId() . $session->user->username;
$cacheKey = $session->getId() . ($session->user->username ?? '');
} else {
$cacheKey = '';
}
Expand Down

0 comments on commit 60316d1

Please sign in to comment.