Skip to content

Commit

Permalink
Early return when no src attribute can be found
Browse files Browse the repository at this point in the history
  • Loading branch information
Baspa committed Oct 10, 2023
1 parent a7f4b1e commit 6bc1dcd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/Checks/Content/AltTagCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,10 @@ private function filterImage($node): ?string
{
$src = $node->attr('src');

if (! $src) {
return null;
}

if (str_contains($src, '.svg')) {
return $src;
}
Expand Down

0 comments on commit 6bc1dcd

Please sign in to comment.