Skip to content

Commit

Permalink
BUGFIX: Provide better error message if node could not be found on di…
Browse files Browse the repository at this point in the history
…scard
  • Loading branch information
grebaldi committed May 23, 2023
1 parent ef72c79 commit 5e6c01e
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions Classes/Controller/BackendServiceController.php
Original file line number Diff line number Diff line change
Expand Up @@ -269,6 +269,14 @@ public function discardAction(array $nodeContextPaths): void
try {
foreach ($nodeContextPaths as $contextPath) {
$node = $this->nodeService->getNodeFromContextPath($contextPath, null, null, true);
if (!$node) {
$error = new Error();
$error->setMessage(sprintf('Could not find node for context path "%s"', $contextPath));

$this->feedbackCollection->add($error);
continue;
}

if ($node->isRemoved() === true) {
// When discarding node removal we should re-create it
$updateNodeInfo = new UpdateNodeInfo();
Expand Down

0 comments on commit 5e6c01e

Please sign in to comment.