File tree Expand file tree Collapse file tree 1 file changed +8
-3
lines changed
app/code/Magento/Review/Controller/Product Expand file tree Collapse file tree 1 file changed +8
-3
lines changed Original file line number Diff line number Diff line change 5
5
*/
6
6
namespace Magento \Review \Controller \Product ;
7
7
8
+ use Magento \Framework \Exception \LocalizedException ;
8
9
use Magento \Review \Controller \Product as ProductController ;
9
10
use Magento \Framework \Controller \ResultFactory ;
10
11
@@ -17,9 +18,13 @@ class ListAjax extends ProductController
17
18
*/
18
19
public function execute ()
19
20
{
20
- $ this ->initProduct ();
21
- /** @var \Magento\Framework\View\Result\Layout $resultLayout */
22
- $ resultLayout = $ this ->resultFactory ->create (ResultFactory::TYPE_LAYOUT );
21
+ if (!$ this ->initProduct ()) {
22
+ throw new LocalizedException (__ ('Cannot initialize product ' ));
23
+ } else {
24
+ /** @var \Magento\Framework\View\Result\Layout $resultLayout */
25
+ $ resultLayout = $ this ->resultFactory ->create (ResultFactory::TYPE_LAYOUT );
26
+ }
27
+
23
28
return $ resultLayout ;
24
29
}
25
30
}
You can’t perform that action at this time.
0 commit comments