qax-os / excelize

Go language library for reading and writing Microsoft Excel™ (XLAM / XLSM / XLSX / XLTM / XLTX) spreadsheets
https://xuri.me/excelize
BSD 3-Clause "New" or "Revised" License
18.41k stars 1.72k forks source link

Panic in GetBaseColor() #1981

Closed fasdalf closed 2 months ago

fasdalf commented 3 months ago

Description

Alternative XLSX editors can make Excelize panic on styles loading. Screenshot from 2024-08-28 13-58-48

Steps to reproduce the issue:

  1. Save file with some cell background and text colors changed in alternative client "R7 Office"
  2. Call GetStyle(cellStyleID)

Describe the results you received: Get "invalid memory address or nil pointer dereference" panic

Describe the results you expected: code continues to modify and apply new style

Output of go version:

go version go1.19.13 linux/amd64

Excelize version or commit ID:

github.com/xuri/excelize/v2 v2.8.1

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

xuri commented 3 months ago

Thanks for your issue. This duplicated with #1963, this issue has been fixed in the master branch, please upgrade to the master branch code by go get -u github.com/xuri/excelize/v2@master, and this patch will be released in the next version.

xuri commented 2 months ago

I'll close this, if you have any questions, please let me know, and you can reopen this anytime.