diff --git a/src/PhpWord/Shared/Html.php b/src/PhpWord/Shared/Html.php index c937d299..3253b83c 100644 --- a/src/PhpWord/Shared/Html.php +++ b/src/PhpWord/Shared/Html.php @@ -160,8 +160,10 @@ class Html } $attributeClass = $attributes->getNamedItem('class'); - if ($attributeClass && self::$css) { - $styles = self::parseStyleDeclarations(self::$css->getStyle('.' . $attributeClass->value), $styles); + if ($attributeClass) { + if (self::$css) { + $styles = self::parseStyleDeclarations(self::$css->getStyle('.' . $attributeClass->value), $styles); + } $styles['className'] = $attributeClass->value; }