From d84050921eddf5c4221f8723477be2ac93f56ecc Mon Sep 17 00:00:00 2001 From: xuri Date: Tue, 23 Feb 2021 00:05:19 +0800 Subject: check empty rich text run properties; new formula fn: LEFT, LEFTB, RIGHT, RIGHTB --- cell.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'cell.go') diff --git a/cell.go b/cell.go index ea4e1d0..892a906 100644 --- a/cell.go +++ b/cell.go @@ -522,13 +522,13 @@ func (f *File) GetCellRichText(sheet, cell string) (runs []RichTextRun, err erro font := Font{} font.Bold = v.RPr.B != nil font.Italic = v.RPr.I != nil - if nil != v.RPr.U { + if v.RPr.U != nil && v.RPr.U.Val != nil { font.Underline = *v.RPr.U.Val } - if nil != v.RPr.RFont { + if v.RPr.RFont != nil && v.RPr.RFont.Val != nil { font.Family = *v.RPr.RFont.Val } - if nil != v.RPr.Sz { + if v.RPr.Sz != nil && v.RPr.Sz.Val != nil { font.Size = *v.RPr.Sz.Val } font.Strike = v.RPr.Strike != nil -- cgit v1.2.1