From ef334ee658e6d4d7279e3a12e292d8c8f3800f77 Mon Sep 17 00:00:00 2001 From: peiqi Date: Thu, 8 Nov 2018 11:43:29 +0800 Subject: [PATCH] fix issue #290 --- cell.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/cell.go b/cell.go index 1277a18..aa4067f 100644 --- a/cell.go +++ b/cell.go @@ -244,12 +244,13 @@ func (f *File) GetCellFormula(sheet, axis string) string { if xlsx.SheetData.Row[k].R == row { for i := range xlsx.SheetData.Row[k].C { if axis == xlsx.SheetData.Row[k].C[i].R { + if xlsx.SheetData.Row[k].C[i].F == nil { + continue + } if xlsx.SheetData.Row[k].C[i].F.T == STCellFormulaTypeShared { return getSharedForumula(xlsx, xlsx.SheetData.Row[k].C[i].F.Si) } - if xlsx.SheetData.Row[k].C[i].F != nil { - return xlsx.SheetData.Row[k].C[i].F.Content - } + return xlsx.SheetData.Row[k].C[i].F.Content } } }