From e820388d70da551cacdf3212b559d597a6fdbec8 Mon Sep 17 00:00:00 2001 From: Ri Xu Date: Tue, 19 Sep 2017 11:59:33 +0800 Subject: Handle coordinate parse exception, relate issue #122. --- styles.go | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'styles.go') diff --git a/styles.go b/styles.go index ee0fbc2..c20bd82 100644 --- a/styles.go +++ b/styles.go @@ -2279,12 +2279,18 @@ func (f *File) SetCellStyle(sheet, hcell, vcell string, styleID int) { // Coordinate conversion, convert C1:B3 to 2,0,1,2. hcol := string(strings.Map(letterOnlyMapF, hcell)) - hrow, _ := strconv.Atoi(strings.Map(intOnlyMapF, hcell)) + hrow, err := strconv.Atoi(strings.Map(intOnlyMapF, hcell)) + if err != nil { + return + } hyAxis := hrow - 1 hxAxis := TitleToNumber(hcol) vcol := string(strings.Map(letterOnlyMapF, vcell)) - vrow, _ := strconv.Atoi(strings.Map(intOnlyMapF, vcell)) + vrow, err := strconv.Atoi(strings.Map(intOnlyMapF, vcell)) + if err != nil { + return + } vyAxis := vrow - 1 vxAxis := TitleToNumber(vcol) -- cgit v1.2.1