From 47198989b93eb9d0aab629b46ff12c87b73036bc Mon Sep 17 00:00:00 2001 From: Adam Koppe Date: Thu, 7 Nov 2024 11:02:09 +0100 Subject: [PATCH] [BUGFIX] NPE in Index Queue module when no site is selected In multi site setups a null pointer exception is thrown when opening the Index Queue TYPO3 module without having a solr-enabled page selected in the page tree. The NPE is thrown in `::initializeAction()` before the original handling of the "no site selected" case in `::indexAction()`. Fixes: 3ea271319 ("[TASK:BP:11.6] Consider queue initialization status") --- .../Controller/Backend/Search/IndexQueueModuleController.php | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Classes/Controller/Backend/Search/IndexQueueModuleController.php b/Classes/Controller/Backend/Search/IndexQueueModuleController.php index 4bb248d7ae..d8685047fc 100644 --- a/Classes/Controller/Backend/Search/IndexQueueModuleController.php +++ b/Classes/Controller/Backend/Search/IndexQueueModuleController.php @@ -336,6 +336,10 @@ protected function addIndexQueueFlashMessage(string $label, int $severity) */ protected function getIndexQueues(): array { + if ($this->selectedSite === null) { + return []; + } + $queues = []; $configuration = $this->selectedSite->getSolrConfiguration(); foreach ($configuration->getEnabledIndexQueueConfigurationNames() as $indexingConfiguration) {