Updated to 19.2.0.46, SfDropdownList now throwing a null reference exception when the dialog it is nested within is displayed for a second time.
System.NullReferenceException: Object reference not set to an instance of an object.
at Syncfusion.Blazor.Internal.SfBaseUtils.UpdateDictionary(String key, Object data, Dictionary`2 dictionary)
at Syncfusion.Blazor.DropDowns.SfDropDownList`2.DynamicPropertyUpdate()
at Syncfusion.Blazor.DropDowns.SfDropDownList`2.OnParametersSetAsync()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)
The error can be reproduced every time, sample attached. I have kept the sample as simple as possible, but reflecting our actual use case. The dropdown on the dialog in my sample is using an unchanging list; it's DataSource and @bind-value are not being used. However, the dropdowns in our actual projects will potentially be dynamic DataSources and bound to a model. The error occurs in both cases now.
It was fine on the previous version we were using (Which was 19.1.0.59).
This is a critical issue for us.
Thanks Berly, the sample you've sent back doesn't produce the issue now.
I will test the latest update but if the other issue I have reported isn't fixed, I won't be able to use it:
Urgent - SfGrid and SfPivotView causing fatal exceptions when the collection provided to their DataSource is empty. | Blazor Forums | Syncfusion
Hi Lee,
We have considered the reported issue as a bug and logged the defect report “Exception throws while updating pivot table with empty datasource” for the same. We will include the fix in our upcoming weekly patch release which is estimated to be rolled out on 21st July 2021. You can keep track the issue in the feedback link below. We appreciate your patience until then.
Feedback Link: https://www.syncfusion.com/feedback/27004/exception-throws-while-updating-pivot-table-with-empty-datasource
Note: You must login to view the above
feedback link since it is private.
Thanks again Berly, I can confirm that the dropdown issue no longer occurs with 19.2.0.47.
We are having to wait for the 21st July release for the aforementioned Grid and Pivot table issues anyway and hopefully our newly reported issue with editting events on the SfSchedule control will also be fixed.
NullReferenceException means that you are trying to use a reference variable whose value is Nothing/null . When the value is Nothing/null for the reference variable, which means that it is not actually holding a reference to an instance of any object that exists on the heap.
string str = null;
str.ToUpper();
Above c# code throws a NullReferenceException at the second line because you can't call the instance method ToUpper() on a string reference pointing to null.