Skip to content

Commit 05a4f70

Browse files
committed
BUGFIX: Fix empty templates
1 parent 137b802 commit 05a4f70

1 file changed

Lines changed: 7 additions & 3 deletions

File tree

Classes/NodeTemplateDumper/NodeTemplateDumper.php

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,21 @@ public function createNodeTemplateYamlDumpFromSubtree(NodeInterface $startingNod
4242

4343
$template = $this->nodeTemplateFromNodes([$startingNode], $comments);
4444

45+
$firstEntry = null;
4546
foreach ($template as $firstEntry) {
4647
break;
4748
}
48-
assert(isset($firstEntry));
49+
50+
$properties = $firstEntry['properties'] ?? null;
51+
$childNodes = $firstEntry['childNodes'] ?? null;
52+
4953

5054
$templateInNodeTypeOptions = [
5155
$nodeType->getName() => [
5256
'options' => [
5357
'template' => array_filter([
54-
'properties' => $firstEntry['properties'] ?? null,
55-
'childNodes' => $firstEntry['childNodes'] ?? null,
58+
'properties' => $properties,
59+
'childNodes' => $childNodes
5660
])
5761
]
5862
]

0 commit comments

Comments
 (0)