From 2f74ec171d8c42367666014fa661eab26f088e68 Mon Sep 17 00:00:00 2001 From: william Date: Mon, 24 May 2021 15:27:36 +0800 Subject: fix the bug when there was no count attribute in sharedStrings file --- rows.go | 3 +++ 1 file changed, 3 insertions(+) (limited to 'rows.go') diff --git a/rows.go b/rows.go index 4147662..d8750eb 100644 --- a/rows.go +++ b/rows.go @@ -322,6 +322,9 @@ func (f *File) sharedStringsReader() *xlsxSST { Decode(&sharedStrings); err != nil && err != io.EOF { log.Printf("xml decode error: %s", err) } + if sharedStrings.Count == 0 { + sharedStrings.Count = len(sharedStrings.SI) + } if sharedStrings.UniqueCount == 0 { sharedStrings.UniqueCount = sharedStrings.Count } -- cgit v1.2.1