From ee7cbeb07f401dc473e1a84903698a0cc73e792e Mon Sep 17 00:00:00 2001 From: Alexander Ebert Date: Thu, 28 Sep 2017 14:01:34 +0200 Subject: [PATCH] Added missing check for the article image --- wcfsetup/install/files/lib/page/ArticlePage.class.php | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/wcfsetup/install/files/lib/page/ArticlePage.class.php b/wcfsetup/install/files/lib/page/ArticlePage.class.php index 573a6100ca..f2c6d1e14b 100644 --- a/wcfsetup/install/files/lib/page/ArticlePage.class.php +++ b/wcfsetup/install/files/lib/page/ArticlePage.class.php @@ -111,8 +111,11 @@ class ArticlePage extends AbstractArticlePage { if ($this->articleContent->getTeaserImage()) { MetaTagHandler::getInstance()->addTag('og:image', 'og:image', $this->articleContent->getTeaserImage()->getLink(), true); - MetaTagHandler::getInstance()->addTag('og:image:width', 'og:image:width', $this->articleContent->getImage()->width, true); - MetaTagHandler::getInstance()->addTag('og:image:height', 'og:image:height', $this->articleContent->getImage()->height, true); + + if ($this->articleContent->getImage()) { + MetaTagHandler::getInstance()->addTag('og:image:width', 'og:image:width', $this->articleContent->getImage()->width, true); + MetaTagHandler::getInstance()->addTag('og:image:height', 'og:image:height', $this->articleContent->getImage()->height, true); + } } // add tags as keywords -- 2.20.1