-
-
Notifications
You must be signed in to change notification settings - Fork 1.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
When I do not set the conditional formatting style, I will get an nil error #1748
Comments
The excel file is below: |
Thanks for your issue. This issue already has been fixed by commit 866f308. Please upgrade to the master branch code, and this patch will be released in the next version. I've closed this, if it still not work, please let me know, and you can reopen this anytime. |
@xuri I found something wrong in this commit, if there is a condition A with style ,the unstyled condition will be applied with A's style. func (f *File) extractCondFmtCellIs(c *xlsxCfRule, extLst *xlsxExtLst) ConditionalFormatOptions {
format := ConditionalFormatOptions{StopIfTrue: c.StopIfTrue, Type: "cell", Criteria: operatorType[c.Operator]}
if c.DxfID != nil {
format.Format = *c.DxfID
}
if len(c.Formula) == 2 {
format.MinValue, format.MaxValue = c.Formula[0], c.Formula[1]
return format
}
format.Value = c.Formula[0]
return format
} because the condition A's DxfID is 0,that is to say c.DxfID is 0 , and the unstyled condition's DxfID is nil, format default is 0,so after extract,they all will be 0,we can't distinguish who is unstyled |
Thanks for the feedback. This same as issue #1867. I've fixed it. Please upgrade to the master branch code, and this breaking change will be released in the next version. |
Description
Reading a file with conditional formatting as cell values, but without formatting, GetConditionalFormats() will return a nil error. It was found that the issue was caused by DxfID being nil. We hope to fix this issue
And I have found that errors can also occur if the conditional format type is null and not formatted. I hope you can handle similar unformatted scenarios.
The text was updated successfully, but these errors were encountered: