We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 50ceb94 commit 09d2ec1Copy full SHA for 09d2ec1
Classes/Service/CommentService.php
@@ -62,7 +62,10 @@ protected function createNode(NodeInterface $commentCollection, CommentDtoInterf
62
63
if ($this->addCommentToTop) {
64
$firstComment = $commentCollection->getChildNodes(null, 1);
65
- $commentNode->moveBefore($firstComment[0]);
+
66
+ if ($firstComment) {
67
+ $commentNode->moveBefore($firstComment[0]);
68
+ }
69
}
70
71
return $commentNode;
0 commit comments