Skip to content

Commit a6b6d01

Browse files
authored
Merge pull request Flowpack#43 from dlubitz/dlubitz-index-hidden
BUGFIX Catch exception if parent is not available
2 parents 901f6ab + 84921e7 commit a6b6d01

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

Classes/Indexer/NodeIndexer.php

+10-6
Original file line numberDiff line numberDiff line change
@@ -249,13 +249,17 @@ protected function findFulltextRoot(NodeInterface $node): ?NodeInterface
249249
return null;
250250
}
251251

252-
$currentNode = $node->findParentNode();
253-
while ($currentNode !== null) {
254-
if (in_array($currentNode->getNodeType()->getName(), $this->fulltextRootNodeTypes, true)) {
255-
return $currentNode;
256-
}
252+
try {
253+
$currentNode = $node->findParentNode();
254+
while ($currentNode !== null) {
255+
if (in_array($currentNode->getNodeType()->getName(), $this->fulltextRootNodeTypes, true)) {
256+
return $currentNode;
257+
}
257258

258-
$currentNode = $currentNode->findParentNode();
259+
$currentNode = $currentNode->findParentNode();
260+
}
261+
} catch (NodeException $exception) {
262+
return null;
259263
}
260264

261265
return null;

0 commit comments

Comments
 (0)