Skip to content

f.formattedValue runtime error: invalid memory address or nil pointer dereference #529

@wubin1989

Description

@wubin1989

Description

Steps to reproduce the issue:

  1. xlsx, err = excelize.OpenReader(resp.Body)
  2. sheetName := xlsx.GetSheetName(xlsx.GetActiveSheetIndex())
  3. rows, err = xlsx.GetRows(sheetName)

Describe the results you received:
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0xb2c055]
goroutine 82
[running]:
github.com/360EntSecGroup-Skylar/excelize/v2.(*xlsxC).getValueFrom(0xc0103d1348, 0xc0000ffb00, 0xc0002b80a0, 0x1, 0x0, 0x0, 0xc0103d1310)
/data/wubin/gopath/pkg/mod/github.com/360!ent!sec!group-!skylar/excelize/v2@v2.0.2/rows.go:214 +0xe5
github.com/360EntSecGroup-Skylar/excelize/v2.(*Rows).Columns(0xc03612e000, 0x0, 0x40, 0xc00013c000, 0x0, 0x0)
/data/wubin/gopath/pkg/mod/github.com/360!ent!sec!group-!skylar/excelize/v2@v2.0.2/rows.go:80 +0x1c9
github.com/360EntSecGroup-Skylar/excelize/v2.(*File).GetRows(0xc0000ffb00, 0xc000392360, 0x6, 0x1, 0x1, 0x14, 0x0, 0x0)
/data/wubin/gopath/pkg/mod/github.com/360!ent!sec!group-!skylar/excelize/v2@v2.0.2/rows.go:41 +0xe4
Describe the results you expected:
no panic and get rows
Output of go version:

go version go1.12.6 linux/amd64

Excelize version or commit ID:

v2.0.2

Environment details (OS, Microsoft Excel™ version, physical, etc.):

Activity

wubin1989

wubin1989 commented on Dec 9, 2019

@wubin1989
Author

442.xlsx
This is test file.
Help!

xuri

xuri commented on Dec 10, 2019

@xuri
Member

Hi @wubin1989, thanks for your issue. I have fixed it. Please try to upgrade the library with the master branch code.

wubin1989

wubin1989 commented on Dec 11, 2019

@wubin1989
Author

@xuri Many thanks!

added a commit that references this issue on Oct 23, 2020
a5c74bd
added a commit that references this issue on Mar 14, 2024
5d8365c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    confirmedThis issue can be reproduced

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @xuri@wubin1989

        Issue actions

          f.formattedValue runtime error: invalid memory address or nil pointer dereference · Issue #529 · qax-os/excelize