fix: RendererSerializer.AddArrayProp obj cast NRE for struct arrays (int,double) - #324
Open
damyanpetev wants to merge 1 commit into
Open
fix: RendererSerializer.AddArrayProp obj cast NRE for struct arrays (int,double)#324damyanpetev wants to merge 1 commit into
damyanpetev wants to merge 1 commit into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR fixes serialization of value-type arrays (e.g., int[], double[]) when sending array properties over the Ignite UI for Blazor renderer interop. It updates RendererSerializer.AddArrayProp to accept a generic IEnumerable<T> so it can iterate value-type arrays directly, and adds/updates a combo contract test to cover the scenario.
Changes:
- Changed
RendererSerializer.AddArrayPropfromobject+as object[]to a genericIEnumerable<T>implementation to avoid null/failed casts for struct arrays. - Updated combo interop contract tests to assert correct wiring of a keyed combo value using a value-type array (
double[]).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| tests/IgniteUI.Blazor.Tests/ComboTests.cs | Adds a contract assertion that a keyed combo’s value array is transmitted as raw JSON numbers (covers value-type array serialization). |
| src/componentsBase/RendererSerializer.cs | Makes AddArrayProp generic over IEnumerable<T> to correctly serialize struct arrays without relying on object[] casting. |
damyanpetev
force-pushed
the
dpetev/combo-array-prop-fix
branch
from
August 7, 2026 17:14
b15b45d to
aebd62c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Property value set with struct types (int, double) didn't work -
RendererSerializer.AddArrayPropobject cast fails for those values and producednullresult which causes an immediateNullReferenceExceptionafter trying to accessvaluesArray.Lengthbecause the check is for the original paramvalues.This is reproducible by setting
IgbCombo.Valueto an array of such struct values, sayint[]withValueKey="Id"scenario.I've updated the method to be generic and accept and enumerable instead so it can directly iterate over that. The null check is probably redundant, but CBA fixing everything in this class in one go :)
Type of Change (check all that apply):
Component(s) / Area(s) Affected:
How Has This Been Tested?
Test Configuration:
Screenshots / Recordings
Checklist:
README.MDCHANGELOG.MDupdates for newly added functionalityCloses #