diff --git a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php index 628344e95867b..17ef431d59011 100644 --- a/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php +++ b/app/code/Magento/Catalog/Controller/Adminhtml/Product/Set/Edit.php @@ -55,7 +55,15 @@ public function __construct( public function execute() { $this->_setTypeId(); - $attributeSet = $this->attributeSetRepository->get($this->getRequest()->getParam('id')); + + try { + $attributeSet = $this->attributeSetRepository->get($this->getRequest()->getParam('id')); + } catch (NoSuchEntityException $e) { + $this->messageManager->addErrorMessage(__('Could not load attribute set.')); + + return $this->_redirect('*/*/'); + } + if (!$attributeSet->getId()) { return $this->resultRedirectFactory->create()->setPath('catalog/*/index'); }