diff --git a/Classes/Controller/BackendServiceController.php b/Classes/Controller/BackendServiceController.php index 54dfa87b20..cae2de946d 100644 --- a/Classes/Controller/BackendServiceController.php +++ b/Classes/Controller/BackendServiceController.php @@ -189,11 +189,18 @@ protected function updateWorkspaceInfo(string $documentNodeContextPath): void { $updateWorkspaceInfo = new UpdateWorkspaceInfo(); $documentNode = $this->nodeService->getNodeFromContextPath($documentNodeContextPath, null, null, true); - $updateWorkspaceInfo->setWorkspace( - $documentNode->getContext()->getWorkspace() - ); + if ($documentNode === null) { + $error = new Error(); + $error->setMessage(sprintf('Could not find node for document node context path "%s"', $documentNodeContextPath)); + + $this->feedbackCollection->add($error); + } else { + $updateWorkspaceInfo->setWorkspace( + $documentNode->getContext()->getWorkspace() + ); - $this->feedbackCollection->add($updateWorkspaceInfo); + $this->feedbackCollection->add($updateWorkspaceInfo); + } } /** @@ -237,6 +244,14 @@ public function publishAction(array $nodeContextPaths, string $targetWorkspaceNa foreach ($nodeContextPaths as $contextPath) { $node = $this->nodeService->getNodeFromContextPath($contextPath, null, null, true); + if ($node === null) { + $error = new Info(); + $error->setMessage(sprintf('Could not find node for context path "%s"', $contextPath)); + + $this->feedbackCollection->add($error); + + continue; + } $this->publishingService->publishNode($node, $targetWorkspace); if ($node->getNodeType()->isAggregate()) {