Skip to content

Commit

Permalink
Fixed review list ajax if product not exist redirect to 404 page #13102
Browse files Browse the repository at this point in the history
  • Loading branch information
ananth-iyer authored and mage2pratik committed Aug 15, 2018
1 parent 964f7b0 commit 81c0320
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions app/code/Magento/Review/Controller/Product/ListAjax.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,12 +14,15 @@ class ListAjax extends ProductController
/**
* Show list of product's reviews
*
* @return \Magento\Framework\View\Result\Layout
* @return \Magento\Framework\App\ResponseInterface|\Magento\Framework\Controller\ResultInterface|\Magento\Framework\View\Result\Layout
*/
public function execute()
{
if (!$this->initProduct()) {
throw new LocalizedException(__('Cannot initialize product'));
/** @var \Magento\Framework\Controller\Result\Forward $resultForward */
$resultForward = $this->resultFactory->create(ResultFactory::TYPE_FORWARD);
$resultForward->forward('noroute');
return $resultForward;
} else {
/** @var \Magento\Framework\View\Result\Layout $resultLayout */
$resultLayout = $this->resultFactory->create(ResultFactory::TYPE_LAYOUT);
Expand Down

0 comments on commit 81c0320

Please sign in to comment.