Skip to content

Commit 5cd5ffe

Browse files
committed
If no expression can be build, the selector is invalid
1 parent 9a6f2e3 commit 5cd5ffe

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/CssFromHTMLExtractor.php

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -149,6 +149,10 @@ function (Rule $rule) use ($xPath, $cssIdentifier, $htmlIdentifier) {
149149

150150
$expression = $this->buildExpressionForSelector($rule->getSelector());
151151

152+
if (!$expression) {
153+
return false;
154+
}
155+
152156
/** @var DOMNodeList $elements */
153157
$elements = $xPath->query($expression);
154158

0 commit comments

Comments
 (0)