Add nil checks to prevent crash UO-26 (#397)

This commit is contained in:
Gunnsteinn Hall 2020-06-05 12:44:02 +00:00 committed by GitHub
parent 9f7935e5d0
commit cd8c690655
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View File

@ -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
}
}

View File

@ -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
}
}