mirror of
https://github.com/unidoc/unioffice.git
synced 2025-04-25 13:48:53 +08:00
Add nil checks to prevent crash UO-26 (#397)
This commit is contained in:
parent
9f7935e5d0
commit
cd8c690655
@ -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
|
||||
}
|
||||
}
|
||||
|
@ -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
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user