diff --git a/document/paragraphproperties.go b/document/paragraphproperties.go index 8c46b361..c9f8f6b0 100644 --- a/document/paragraphproperties.go +++ b/document/paragraphproperties.go @@ -370,7 +370,7 @@ func (p ParagraphProperties) Underline() wml.ST_Underline { func (p ParagraphProperties) UnderlineColor() string { if underline := p.x.RPr.U; underline != nil { color := underline.ColorAttr - if color.ST_HexColorRGB != nil { + if color != nil && color.ST_HexColorRGB != nil { return *color.ST_HexColorRGB } } diff --git a/document/runproperties.go b/document/runproperties.go index c8f3c5c8..5cf2e80f 100644 --- a/document/runproperties.go +++ b/document/runproperties.go @@ -415,7 +415,7 @@ func (r RunProperties) Underline() wml.ST_Underline { func (r RunProperties) UnderlineColor() string { if underline := r.x.U; underline != nil { color := underline.ColorAttr - if color.ST_HexColorRGB != nil { + if color != nil && color.ST_HexColorRGB != nil { return *color.ST_HexColorRGB } }