Skip to content

Commit

Permalink
fix null value
Browse files Browse the repository at this point in the history
  • Loading branch information
lekoala committed Jul 26, 2023
1 parent a4566d1 commit d71c772
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/EmailUtils.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,11 @@ class EmailUtils
*/
public static function inline_styles($html, $css = '')
{
$domDocument = CssInliner::fromHtml($html)->inlineCss($css)->getDomDocument();
if ($css) {
$domDocument = CssInliner::fromHtml($html)->inlineCss($css)->getDomDocument();
} else {
$domDocument = CssInliner::fromHtml($html)->getDomDocument();
}

HtmlPruner::fromDomDocument($domDocument)->removeElementsWithDisplayNone();
$html = CssToAttributeConverter::fromDomDocument($domDocument)
Expand Down

0 comments on commit d71c772

Please sign in to comment.