From ae065d8a28f475e8436ec130de3716d0d3e4775f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stephan=20Hochd=C3=B6rfer?= Date: Tue, 7 Aug 2018 08:41:01 +0200 Subject: [PATCH] Remove dead code \Magento\Cms\Model\Page::load() returns $this thus the if condition will never evaluate as false. And since there is an id check afterwards anyways we should be save. --- app/code/Magento/Cms/Helper/Page.php | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/app/code/Magento/Cms/Helper/Page.php b/app/code/Magento/Cms/Helper/Page.php index bf51c5f0210e9..a421f89e07d6a 100644 --- a/app/code/Magento/Cms/Helper/Page.php +++ b/app/code/Magento/Cms/Helper/Page.php @@ -189,9 +189,7 @@ public function getPageUrl($pageId = null) $page = $this->_pageFactory->create(); if ($pageId !== null && $pageId !== $page->getId()) { $page->setStoreId($this->_storeManager->getStore()->getId()); - if (!$page->load($pageId)) { - return null; - } + $page->load($pageId); } if (!$page->getId()) {