Chart components in recent versions of Syncfusion Blazor throw exceptions when receiving null parameters

My team is currently working on upgrading our Syncfusion.Blazor package in our project from version 18.3.0.53 to 19.2.0.48. However, we have noticed a persistent issue across the chart component that is making this upgrade extremely ​tedious. In particular, various parameters in chart-related components (potentially others, but charts are currently being focused on right now) can no longer seem to be null. Setting a null value for a parameter such as Height in the SfChart component results in this exception being thrown:

blazor.server.js:21 [2021-07-28T18:10:13.800Z] Error: System.NullReferenceException: Object reference not set to an instance of an object. at Syncfusion.Blazor.Charts.SfChart.ProcessChart() at Syncfusion.Blazor.Charts.SfChart.OnAfterRenderAsync(Boolean firstRender) at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle)

The reason why this makes things so tedious for my team is that we have connected charts and other Syncfusion components to a visual editor in which users can declare the properties of chart components using widgets. If no input is present or a given property, that value is treated as null, which is what the chart component receives. Previously, the chart components seemed to treat most instances of null parameters as if that parameter had never been received in the first place. 

<SfChart Height="@Widget.Height"Width="@Widget.Width"...

This made it intuitive and straightforward to connect Syncfusion component parameters to those found in our widgets. But now that null parameters are no longer accepted, this process becomes much more difficult for us. So my question is this: is throwing exceptions on null parameters a bug that we can expect to see fixed sometime soon? Or is this a permanent, by-design change for Syncfusion components?


6 Replies 1 reply marked as answer

JM Justin Millard July 28, 2021 07:04 PM UTC

Also, it might be worth noting that after some investigation, it seems that this issue first arose in version 19.1.0.57 of Syncfusion.Blazor.



DG Durga Gopalakrishnan Syncfusion Team July 29, 2021 01:12 PM UTC

Hi Justin, 

Greetings from Syncfusion. 

We have validated your reported scenario with attached snippet and console error. We have considered this as bug and logged a defect report. This fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on 17th August 2021. We appreciate your patience until then. You can keep track of the bug from the below feedback link. 
 

If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.  

Regards, 
Durga G 



DG Durga Gopalakrishnan Syncfusion Team August 18, 2021 02:27 PM UTC

Hi Justin, 

We have resolved the reported scenario and generated custom nugget. We request you to ensure your application by installing this custom nugget. We have attached the tested sample for your reference.  



We have attached the document on how to add custom nugget. 


Kindly revert us if you have any concerns. 

Regards, 
Durga G

Marked as answer

JM Justin Millard replied to Durga Gopalakrishnan September 28, 2021 06:16 PM UTC

Your fix did not solve this issue whatsoever. Your sample has a string with the words "null" as the width and height parameters in the SfChart component. That's not a null value. When I pass in an actual null value into these parameters, I get the same error that I was getting before. Furthermore, my issue goes far beyond just the with and height parameters. My team's fundamental issue is that it is now very difficult to templatize Syncfusion components after version 19.1.0.57. In older versions, passing in a null value into a Syncfusion component parameter of a nullable type was effectively the same as not passing in the parameter at all. But now, doing so causes almost any given component (at least the chart ones) to throw exceptions. This make it very difficult for my team to update our project to most recent Syncfusion versions even though we want to, considering the bugs present in older versions that are creating problems for us. Will this fundamental issue of your components throwing errors on null parameters be fixed in a later version? Because until this issue is fixed across the board, we won't upgrade. We might move revoke our Syncfusion license and consider other libraries if this issue is not resolved.




DG Durga Gopalakrishnan Syncfusion Team September 29, 2021 03:51 PM UTC

Hi Justin, 

Sorry for the inconvenience caused. We will consider this case and we will also ensure with all possible scenarios. We have logged a defect report for this issue. This fix will be available in our upcoming weekly patch release which is scheduled to be rolled out on 12th October 2021. We appreciate your patience until then. You can keep track of the bug from the below feedback link. 


If you have any more specification/precise replication procedure or a scenario to be tested, you can add it as a comment in the portal.  

Regards, 
Durga G 



DG Durga Gopalakrishnan Syncfusion Team October 12, 2021 02:25 PM UTC

Hi Justin, 

We are glad to announce that our v19.3.45 patch release is rolled out; we have added the fix for reported issue. You can use the latest Syncfusion.Blazor NuGet package version.  


 


We thank you for your support and appreciate your patience in waiting for this release. Please get in touch with us if you would require any further assistance. 

Regards, 
Durga G

Loader.
Up arrow icon