Skip to content

Commit 4b73f0a

Browse files
committed
Fixed issue in tag::minify() where the parent was not checked for null.
1 parent 7cae381 commit 4b73f0a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/tokens/tag.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -555,7 +555,7 @@ public function minify(array $minify) : void {
555555
}
556556

557557
// work out whether to omit the closing tag
558-
if ($minify['close'] && \in_array($tag, $config['elements']['closeoptional']) && ($this->parent->tagName === null || !\in_array($this->parent->tagName, $config['elements']['inline'], true))) {
558+
if ($minify['close'] && $this->parent !== null && \in_array($tag, $config['elements']['closeoptional']) && ($this->parent->tagName === null || !\in_array($this->parent->tagName, $config['elements']['inline'], true))) {
559559
$children = $this->parent->toArray();
560560
$next = false;
561561
foreach ($children AS $item) {

0 commit comments

Comments
 (0)