Skip to content

Fix @group tag not working with certain IEnumerable types - #723

Merged
shps951023 merged 1 commit into
mini-software:masterfrom
JamesDSource:master
Feb 7, 2025
Merged

Fix @group tag not working with certain IEnumerable types#723
shps951023 merged 1 commit into
mini-software:masterfrom
JamesDSource:master

Conversation

@JamesDSource

@JamesDSource JamesDSource commented Feb 6, 2025

Copy link
Copy Markdown
Contributor

If the IEnumerable type can't be casted to an IList, such as a List of structs, xRowInfo.CellIlListValues will silently be NULL. To fix, I check if it can be casted to IList first, then create one from CellIEnumerableValues if it can't. Later in generating a template, this issue would have caused a NullReferenceException when parsing the @endgroup tag.

Removed a redundent check for cellValue is IList<object>, because all IList types are IEnumerable.

Added a test for groups that would trigger a NullReferenceException before this patch.

@shps951023
shps951023 merged commit 8136154 into mini-software:master Feb 7, 2025
@shps951023

Copy link
Copy Markdown
Member

@JamesDSource Merged 🙌, and e-mail invitation for you, thanks

pull Bot pushed a commit to zilo555/MiniExcel that referenced this pull request Aug 29, 2026
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