Typo3 由于信号槽中缺少对象而出错(tx_新闻)

Typo3 由于信号槽中缺少对象而出错(tx_新闻),typo3,typo3-9.x,tx-news,Typo3,Typo3 9.x,Tx News,我为tx_news编写了一个signalslot扩展,它扩展了detailAction。调用news in detail视图时,dispatcher按预期工作。但是,当调用细节页面时,如果没有现有新闻条目的有效参数,则会出现以下错误: Oops, an error occurred! Argument 1 passed to .....\Slots\NewsControllerSlot::detailActionSlot() must be an instance of GeorgRinger\

我为tx_news编写了一个signalslot扩展,它扩展了detailAction。调用news in detail视图时,dispatcher按预期工作。但是,当调用细节页面时,如果没有现有新闻条目的有效参数,则会出现以下错误:

Oops, an error occurred!
Argument 1 passed to .....\Slots\NewsControllerSlot::detailActionSlot() must be an instance of GeorgRinger\News\Domain\Model\News, null given
错误很容易理解:

public function detailActionSlot(News $newsItem, $currentPage, $demand, $settings, $extendedVariables)
缺少第一个参数$newsItem

但是我怎样才能避免这个错误呢?
谢谢

在github上创建pr或至少是一个问题,这是一个bug

David Bruchman给了我一个提示:

public function detailActionSlot(News $newsItem = null, $currentPage, $demand, $settings, $extendedVariables)
{
    if (is_object($newsItem)) { 
        // do stuff here
   }
}

即使抛出404也能完美工作

谢谢你,乔治,我在github提出了一个问题。但这似乎只是我的一个错误。。。