From e0e355e4f775fbe73858fa32729781df2390ea1c Mon Sep 17 00:00:00 2001 From: Javier Feria Date: Wed, 27 Jul 2016 11:16:27 +0200 Subject: [PATCH] Fix error $page Fix error $page Undefined property --- src/GoogleAnalytics/Internals/Request/EventRequest.php | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/GoogleAnalytics/Internals/Request/EventRequest.php b/src/GoogleAnalytics/Internals/Request/EventRequest.php index 7b8656f..a09c688 100644 --- a/src/GoogleAnalytics/Internals/Request/EventRequest.php +++ b/src/GoogleAnalytics/Internals/Request/EventRequest.php @@ -40,6 +40,10 @@ class EventRequest extends Request { */ protected $event; + /** + * @var \UnitedPrototype\GoogleAnalytics\Page + */ + protected $page; /** * @const int @@ -88,7 +92,7 @@ protected function buildParameters() { $p->utmni = 1; } - if(isset($this->page)) { + if( isset($this->page) && is_object($this->page) ) { $p->utmp = $this->page->getPath(); $p->utmdt = $this->page->getTitle(); if($this->page->getCharset() !== null) { @@ -132,4 +136,4 @@ public function setPage(Page $page) { } -?> \ No newline at end of file +?>