Nested Editor<T> crashing because of bug in HtmlFieldPrefix.Combine method #53956
Labels
area-blazor
Includes: Blazor, Razor Components
bug
This issue describes a behavior which is not expected - a bug.
Milestone
Is there an existing issue for this?
Describe the bug
Nesting more than 2 Editor leads to an exception
Expected Behavior
It should work properly and not throw any exception
Steps To Reproduce
https://github.com/sal-versij/NestedEditorTCrash
Just visit the home
Exceptions (if any)
.NET Version
8.0.100
Anything else?
After searching why this happens, I've found that in HtmlFieldPrefix.cs:23 the loop is not actually looping through the whole
_rest
because it usesrestLength - 1
instead oflength - 1
orrestLength
itself, thus it's ignoring the last element of_rest
that is left as the default value inexpressions
:null
, this is propagated to the inputs inside the innermost editor that, when executing GetFieldName(...) throws because_rest
of the input contains a null value passed to ExpressionFormatter.FormatLambda that throwsNullReferenceException
at ExpressionFormatter.cs:41The text was updated successfully, but these errors were encountered: