Skip to content

Fix angular ticks nre 2012 - #2079

Merged
beto-rodriguez merged 2 commits into
devfrom
fix-angular-ticks-nre-2012
Feb 1, 2026
Merged

Fix angular ticks nre 2012#2079
beto-rodriguez merged 2 commits into
devfrom
fix-angular-ticks-nre-2012

Conversation

@beto-rodriguez

Copy link
Copy Markdown
Collaborator

fixes #2012

Copilot AI review requested due to automatic review settings February 1, 2026 01:11
@github-actions

github-actions Bot commented Feb 1, 2026

Copy link
Copy Markdown

Thanks for your contribution!

The build and test process is starting. This may take a while.
You can find more details below as the process continues or at the actions tab.


All packages have been packed successfully! 📦✅
You can download the NuGet packages for this build here.

The packages will be available for 30 days, you can either use them directly, or wait for this PR to be merged to have them published to NuGet.org.


Tests will start now, you can monitor their progress below or at the actions tab.

Test Results Summary (Passed) ✅ 🥳

0 skipped.
0 failed.
709 passed! ✅

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes a NullReferenceException that occurs when the MaxValue of a PieChart with angular ticks changes dynamically. The issue occurred because the Subseparator array in angular ticks is intentionally sparse - it's created with size 5 but only indices 0-3 are initialized, leaving index 4 as null. When the chart scale changes and old tick visuals are removed, the cleanup code attempted to remove all subseparators including the null ones, causing the crash.

Changes:

  • Added a null check before calling RemoveGeometryFromPaintTask on subseparators in the cleanup loop
  • Added a regression test that reproduces the issue by creating a PieChart with angular ticks and changing its MaxValue

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.

File Description
src/LiveChartsCore/VisualElements/BaseAngularTicksVisual.cs Added null check in cleanup loop to handle intentionally null subseparator array elements
tests/CoreTests/ChartTests/ChartTests.cs Added regression test that changes MaxValue on a PieChart with angular ticks to verify the fix

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread tests/CoreTests/ChartTests/ChartTests.cs
Comment thread src/LiveChartsCore/VisualElements/BaseAngularTicksVisual.cs
@beto-rodriguez
beto-rodriguez merged commit df2edfb into dev Feb 1, 2026
42 checks passed
@beto-rodriguez
beto-rodriguez deleted the fix-angular-ticks-nre-2012 branch February 1, 2026 01:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants