Skip to content

Commit 514b465

Browse files
committed
Prevent fatal when not an object
1 parent 4e01a43 commit 514b465

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/PHPHtmlParser/Dom/Parser.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ public function parse(Options $options, Content $content, int $size): AbstractNo
3737
$root->setHtmlSpecialCharsDecode($options->isHtmlSpecialCharsDecode());
3838
$activeNode = $root;
3939
while ($activeNode !== null) {
40-
if ($activeNode && $activeNode->tag->name() === 'script'
40+
if ($activeNode && is_object( $activeNode->tag ) && $activeNode->tag->name() === 'script'
4141
&& $options->isCleanupInput() !== true
4242
) {
4343
$str = $content->copyUntil('</');

0 commit comments

Comments
 (0)