You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
file.AutoFilter can sometimes error out with a "nil pointer dereference".
I think it's just due to this one bad file and on most files, "file.AutoFilter()" works fine, but it did happen with this file and I couldn't figure out why at first.
Steps to reproduce the issue:
Use this test repo I made with the bad file :
Environment details (OS, Microsoft Excel™ version, physical, etc.):
Here's the output of "go env" :
set GO111MODULE=
set GOARCH=amd64
set GOBIN=
set GOCACHE=C:\Users\bpatt\AppData\Local\go-build
set GOENV=C:\Users\bpatt\AppData\Roaming\go\env
set GOEXE=.exe
set GOEXPERIMENT=
set GOFLAGS=
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOINSECURE=
set GOMODCACHE=C:\Users\bpatt\go\pkg\mod
set GONOPROXY=
set GONOSUMDB=
set GOOS=windows
set GOPATH=C:\Users\bpatt\go
set GOPRIVATE=
set GOPROXY=https://proxy.golang.org,direct
set GOROOT=C:\Program Files\Go
set GOSUMDB=sum.golang.org
set GOTMPDIR=
set GOTOOLCHAIN=auto
set GOTOOLDIR=C:\Program Files\Go\pkg\tool\windows_amd64
set GOVCS=
set GOVERSION=go1.21.1
set GCCGO=gccgo
set GOAMD64=v1
set AR=ar
set CC=gcc
set CXX=g++
set CGO_ENABLED=0
set GOMOD=C:\zzz\repos\autofilterIssueTest\go.mod
set GOWORK=
set CGO_CFLAGS=-O2 -g
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-O2 -g
set CGO_FFLAGS=-O2 -g
set CGO_LDFLAGS=-O2 -g
set PKG_CONFIG=pkg-config
set GOGCCFLAGS=-m64 -fno-caret-diagnostics -Qunused-arguments -Wl,--no-gc-sections -fmessage-length=0 -ffile-prefix-map=C:\Users\bpatt\AppData\Local\Temp\go-build164768209=/tmp/go-build -gno-record-gcc-switches
The text was updated successfully, but these errors were encountered:
- Breaking changes, change the data type for the `HeaderFooterOptions` structure fields `AlignWithMargins` and `ScaleWithDoc` as a pointer
- Fixed panic on `AutoFilter` by adding nil pointer guard for local sheet ID
- Allow dot character in the defined name, table name, or pivot table name
- Update the unit tests
Description
file.AutoFilter can sometimes error out with a "nil pointer dereference".
I think it's just due to this one bad file and on most files, "file.AutoFilter()" works fine, but it did happen with this file and I couldn't figure out why at first.
Steps to reproduce the issue:
Use this test repo I made with the bad file :
git clone "https://github.com/blakepatteson/autofilterIssueTest"
Describe the results you received:
Got a nil pointer dereference panic.
The issue seems to be with this part being possibly nil :
*definedName.LocalSheetID == sheetID
So I think the fix would be just to add a check for this being nil?
Pretty sure the issue is with the "definedNames" part of this specific "test-autofilter-issue.xlsx" workbook :
Describe the results you expected:
Expected Excelize to put a filter on the "test" worksheet with the provided parameters :
Output of
go version
:Excelize version or commit ID:
Environment details (OS, Microsoft Excel™ version, physical, etc.):
Here's the output of "go env" :
The text was updated successfully, but these errors were encountered: