Skip to content

Commit

Permalink
Add check to avoid handling empty html blobs in the crawler
Browse files Browse the repository at this point in the history
  • Loading branch information
Sander De la Marche committed Jul 4, 2022
1 parent d1c5972 commit 87eee20
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Crawler/HtmlCrawler.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,10 @@ class HtmlCrawler
{
public static function makeInternalLinksLocaleAware(string $html, string $locale): string
{
if ($html === '') {
return '';
}

$crawler = new Crawler($html);

foreach ($crawler->filterXPath('//a') as $linkNode) {
Expand Down

0 comments on commit 87eee20

Please sign in to comment.