Skip to content

Commit 929eaf4

Browse files
committed
avoid calling CssStyleFormatter.mergeStyleAttributes if parentStyle or childStyle are null
1 parent 3ea9305 commit 929eaf4

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

aztec/src/main/kotlin/org/wordpress/aztec/plugins/CssUnderlinePlugin.kt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ class CssUnderlinePlugin : ISpanPostprocessor, ISpanPreprocessor {
4141
if (hiddenSpan.TAG == SPAN_TAG) {
4242
val parentStyle = hiddenSpan.attributes.getValue(CssStyleFormatter.STYLE_ATTRIBUTE)
4343
val childStyle = calypsoUnderlineSpan.attributes.getValue(CssStyleFormatter.STYLE_ATTRIBUTE)
44-
hiddenSpan.attributes.setValue(CssStyleFormatter.STYLE_ATTRIBUTE, CssStyleFormatter.mergeStyleAttributes(parentStyle, childStyle))
44+
if (parentStyle != null && childStyle != null) {
45+
hiddenSpan.attributes.setValue(CssStyleFormatter.STYLE_ATTRIBUTE, CssStyleFormatter.mergeStyleAttributes(parentStyle, childStyle))
46+
}
4547

4648
// remove the extra child span
4749
spannable.removeSpan(calypsoUnderlineSpan)

0 commit comments

Comments
 (0)