-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
Description
代码在xmlPivotCache.go文件中存在xlsxCacheSource结构体,内部有5个标签:type、connectionId、worksheetSource、consolidation、extLst
源文件打开成xml后,cacheSource 标签如下:, 不存在worksheetSource标签,WorksheetSource属性本身为空,导致后面代码取出pc.CacheSource.WorksheetSource.Sheet时出现空指针
Steps to reproduce the issue
- 本地文件xml如下
<pivotCacheDefinition xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:xr="http://schemas.microsoft.com/office/spreadsheetml/2014/revision" mc:Ignorable="xr" saveData="0" refreshedBy="AAAA" refreshedDate="45827.477583680557" backgroundQuery="1" createdVersion="7" refreshedVersion="7" minRefreshableVersion="3" recordCount="0" supportSubquery="1" supportAdvancedDrill="1" xr:uid="{C3EDE0DE-36B2-4F3A-856D-0066D92D664C}">
<cacheSource type="external" connectionId="1"/>
中间内容不方便透露
</pivotCacheDefinition>
Describe the results you received
"msg":"runtime error: invalid memory address or nil pointer dereference"
.../github.com/xuri/excelize/v2.(*File).getPivotTable
.../github.com/xuri/excelize/[email protected]/pivotTable.go:875
.../github.com/xuri/excelize/v2.(*File).GetPivotTables
.../github.com/xuri/excelize/[email protected]/pivotTable.go:803
Describe the results you expected
success
Go version
1.22
Excelize version or commit ID
github.com/xuri/excelize/v2 v2.9.1-0.20250105013731-af422e17009b
Environment
Microsoft ExcelValidations
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working