-
Notifications
You must be signed in to change notification settings - Fork 806
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
Error copying range with ConditionalFormat (ColorScale) to new cell. Throws NullReferenceException #1526
Comments
The issue still persists on versions 102.2, 103.0 beta and 104.0 preview. Simply trying to add an existing Worksheet (with 2-Color gradient scale conditional formatting) to a new Workbook object, generates an error almost identical to the one above.
The Conditional Formatting rules don't do anything fancy, all of their ranges are totally valid values. The only thing that seems to make the problem go away is to remove the conditional formatting altogether. The error seems to happen in this line:
The workaround above by @jafin doesn't look like it has made it to the (current) official releases. If you think this deserves a new issue, happy to move it. |
Do you want to request a feature or report a bug?
Did you test against the latest CI build?
Version of ClosedXML
0.95.3 - abe7cc0
What is the current behaviour?
Error copying range with ConditionalFormat (ColorScale) to new cell.
There is an error in XLConditionalFormat when the ConditionalFormat values are read and the value is null (which appears expected for certain conditionalFormat rules)
What is the expected behavior or new feature?
Copying the cell range should complete without error.
Is this a regression from the previous version?
No
Reproducibility
Execute the following test, it will throw an exception
Code to reproduce problem:
Will throw an exception
Workaround
In the XLConditionalFormat.cs Line 262, guarding for a null Value resolves the crash.
ie
The text was updated successfully, but these errors were encountered: