Skip to content

Commit

Permalink
Merge pull request #9 from JanDC/ignore-improper-selectors
Browse files Browse the repository at this point in the history
If no expression can be build, the selector is invalid
  • Loading branch information
JanDC authored Mar 13, 2018
2 parents 9a6f2e3 + 5cd5ffe commit 68cb064
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/CssFromHTMLExtractor.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,10 @@ function (Rule $rule) use ($xPath, $cssIdentifier, $htmlIdentifier) {

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

if (!$expression) {
return false;
}

/** @var DOMNodeList $elements */
$elements = $xPath->query($expression);

Expand Down

0 comments on commit 68cb064

Please sign in to comment.