Fixed potential undefined property in onPageNotFound event handling

This commit is contained in:
Matias Griese
2019-02-28 22:35:37 +02:00
parent b35a892853
commit 026f9cb3a0
2 changed files with 4 additions and 1 deletions

View File

@@ -14,6 +14,7 @@
* Grav 1.6: Fixed `FlexObject::update()` removing fields on save
* Fixed `mkdir(...)` race condition
* Fixed `Obtaining write lock failed on file...`
* Fixed potential undefined property in `onPageNotFound` event handling
# v1.6.0-rc.3
## 02/18/2019

View File

@@ -36,7 +36,9 @@ class PagesProcessor extends ProcessorBase
if (!$page->routable()) {
// If no page found, fire event
$event = $this->container->fireEvent('onPageNotFound', new Event(['page' => $page]));
$event = new Event(['page' => $page]);
$event->page = null;
$event = $this->container->fireEvent('onPageNotFound', $event);
if (isset($event->page)) {
unset ($this->container['page']);