call to a member function addAttributeToFilter() and addCategoryFilter() on null after upgrading Magento 2.3.3

After upgrading to Magento 2.3.3 below filters are not working. protected function _getProductCollection() { return $this->getProducts(); } public function getProducts() { $count = $this->getProductCount(); $category_id = $this->getData(“category_id”); $collection = clone $this->_collection; //$collection = clone $this->_collection; $collection->clear()->getSelect()->reset(Select::WHERE)->reset(Select::ORDER)->reset(Select::LIMIT_COUNT)->reset(Select::LIMIT_OFFSET)->reset(Select::GROUP); if(!$category_id) { $category_id = $this->_storeManager->getStore()->getRootCategoryId(); } $category = $this->categoryFactory->create()->load($category_id); $collection->addMinimalPrice() ->addFinalPrice() ->addTaxPercents() ->addAttributeToSelect(‘name’) ->addAttributeToSelect(‘image’) ->addAttributeToSelect(‘small_image’) ->addAttributeToSelect(‘thumbnail’) ->addAttributeToSelect($this->_catalogConfig->getProductAttributes()) ->addUrlRewrite() ->addAttributeToFilter(‘sw_featured’,…