Skip to content

Commit 09d2ec1

Browse files
author
Marvin Kuhn
authored
Fix: fixed exception on first comment added
1 parent 50ceb94 commit 09d2ec1

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Classes/Service/CommentService.php

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,10 @@ protected function createNode(NodeInterface $commentCollection, CommentDtoInterf
6262

6363
if ($this->addCommentToTop) {
6464
$firstComment = $commentCollection->getChildNodes(null, 1);
65-
$commentNode->moveBefore($firstComment[0]);
65+
66+
if ($firstComment) {
67+
$commentNode->moveBefore($firstComment[0]);
68+
}
6669
}
6770

6871
return $commentNode;

0 commit comments

Comments
 (0)