From 337b539e35ae9333ad3df926f110e026f07c62c1 Mon Sep 17 00:00:00 2001 From: RodrigoDornelles Date: Tue, 1 Jun 2021 16:02:53 -0300 Subject: [PATCH] solve method not exist on null. --- src/SeoBehavior.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/SeoBehavior.php b/src/SeoBehavior.php index 4b7ee72..5268cd2 100644 --- a/src/SeoBehavior.php +++ b/src/SeoBehavior.php @@ -31,7 +31,7 @@ public function __get($name) $metatags = []; foreach($this->metatags as $tag => $attribute) { - if ($this->owner->canGetProperty($attribute)) { + if ($this->owner && $this->owner->canGetProperty($attribute)) { $metatags[$tag] = $this->owner->{$attribute}; } }