Fixed potential undefined property in onPageNotFound event handling

This commit is contained in:
Matias Griese
2019-02-28 22:33:26 +02:00
parent d3ffb5bba7
commit 0de5e0eac1
2 changed files with 4 additions and 1 deletions

View File

@@ -3,6 +3,7 @@
1. [](#bugfix)
* Incorrect 2FA lang code [#1618](https://github.com/getgrav/grav-plugin-admin/issues/1618)
* Fixed potential undefined property in `onPageNotFound` event handling
# v1.9.0-rc.3
## 02/18/2019

View File

@@ -499,7 +499,9 @@ class AdminPlugin extends Plugin
if (empty($this->grav['page'])) {
if ($this->grav['user']->authenticated) {
$event = $this->grav->fireEvent('onPageNotFound');
$event = new Event(['page' => null]);
$event->page = null;
$event = $this->grav->fireEvent('onPageNotFound', $event);
/** @var Page $page */
$page = $event->page;