Здравствуйте, есть модуль для вывода продуктов по id, которые задаются через запятую в бэк офис.

Код:
Код:
$enter_id_product = Configuration::get('PRODS');
        $array_id_product = explode(",", $enter_id_product);

    if(!preg_match('/^[0-9]+(,[0-9]+)*$/', $enter_id_product))
    return false;

        foreach ($array_id_product as $key => $arr) {
            $result[$key]['id_product'] = $arr;
        }

        foreach ($result as $product) {
            $product = (new ProductAssembler($this->context))
                ->assembleProduct($product);
            $presenterFactory = new ProductPresenterFactory($this->context);
            $presentationSettings = $presenterFactory->getPresentationSettings();
            $presenter = new ProductListingPresenter(
                new ImageRetriever(
                    $this->context->link
                ),
                $this->context->link,
                new PriceFormatter(),
                new ProductColorsRetriever(),
                $this->context->getTranslator()
            );
            $template_products[] = $presenter->present(
                $presentationSettings,
                $product,
                $this->context->language
            );
        }

        $this->context->smarty->assign(array(
            'products' => $template_products
        ));

    return $this->display(__FILE__, 'mymodule.tpl');


Если я указываю id несуществующего товара, то получаю ошибку
ContextErrorException in ProductAssembler.php line 93:
Notice: Undefined offset: 0

Вопрос, как можно вставить проверку, что если человек указывает например id товаров 1,5,6 а товар с id=1 удален или выключен, то пропускать его и переходить к следующему, то есть показывать только 5 и 6, если они есть?
Спасибо