Skip to content
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

NullReferenceException in FormItem 0.18.2 #3808

Open
michaelcsikos opened this issue Apr 17, 2024 · 7 comments
Open

NullReferenceException in FormItem 0.18.2 #3808

michaelcsikos opened this issue Apr 17, 2024 · 7 comments

Comments

@michaelcsikos
Copy link

With 0.18.2 we are getting the following crash:

System.NullReferenceException: Object reference not set to an instance of an object.
   at AntDesign.FormItem.<BuildRenderTree>b__128_1(RenderTreeBuilder __builder3)
   at AntDesign.Col.BuildRenderTree(RenderTreeBuilder __builder)
   at Microsoft.AspNetCore.Components.Rendering.ComponentState.RenderIntoBatch(RenderBatchBuilder batchBuilder, RenderFragment renderFragment, Exception& renderFragmentException)

We have rolled back to 0.18.1 for now.

@ElderJames
Copy link
Member

We have fixed this issue in 0.18.3. Please try.

@michaelcsikos
Copy link
Author

I did, but we're using AntDesign.ProLayout as well, and there's no update yet.

@michaelcsikos
Copy link
Author

It still crashes with AntDesign 0.18.3 and AntDesign.ProLayout 0.18.2.

@ElderJames
Copy link
Member

ElderJames commented Apr 17, 2024

How did you use Form that would cause this issue?

@michaelcsikos
Copy link
Author

michaelcsikos commented Apr 17, 2024

We have a Sider with Tabs, then in a tab we have a FormItem with an edit component with edit controls (mostly sliders for numbers and InputNumber).

@LuukGlorie
Copy link
Contributor

LuukGlorie commented Apr 18, 2024

I'm also having the same issue when using a FormItem inside a FormItem. I don't think that's the right way to use it, so I changed that.
The error is actually thrown from:

private AntLabelAlignType? FormLabelAlign => LabelAlign ?? Form.LabelAlign;

So I think changing this to private AntLabelAlignType? FormLabelAlign => LabelAlign ?? Form?.LabelAlign; will fix the issue.

@ElderJames
Copy link
Member

@LuukGlorie Thank you for figuring this,would you please send a PR for it?

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

No branches or pull requests

3 participants