RichTextEditor in Dialog close error

I have a SfRichTextEditor in a SfDialog. If I simply open it and then close it, I receive error:

Error: System.NullReferenceException: Object reference not set to an instance of an object.
   at Syncfusion.Blazor.RichTextEditor.RichTextEditorMediaSettings.ShouldRender()
   at Microsoft.AspNetCore.Components.ComponentBase.StateHasChanged()
   at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
   at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)

Video
https://www.loom.com/share/eb1eb6bdc4d64deba619d03bbf8d3a1f?sid=2dd0f6be-77be-4cfc-8a0e-8c0faf6c8485

Sample Project
Here's a link to project download (upload file failed).
https://sphere-qa.s3.dualstack.us-east-1.amazonaws.com/SFIssues.zip
Be sure to set SF License in in Program.cs

Comments
You'll see "Home.razor" has a button that calls method "StartNewPost()" in "ModalEditor.razor". ModalEditor has the SfDialog and SfRichTextEditor. StartNewPost() simply calls ShowAsync();. When Close is clicked, it simply calls HideAsync();


2 Replies

BT Bhuvaneshwari Thirunavukarasu Syncfusion Team February 20, 2025 10:17 AM UTC

Hi Brian Pautsch,
We have considered the reported issue "RichTextEditor in SfDialog Throws System.NullReferenceException on Close " as a bug from our end and the fix for the issue will be included with our upcoming patch release which is scheduled for the second week of March
Now you can track the status of the reported issue through this feedback,
Disclaimer: “Inclusion of this solution in the weekly release may change due to other factors including but not limited to QA checks and works reprioritization.”
Regards,
Bhuvaneshwari T


BT Bhuvaneshwari Thirunavukarasu Syncfusion Team March 11, 2025 08:51 AM UTC

Hi Brian Pautsch,
Query: "RichTextEditor in SfDialog Throws System.NullReferenceException on Close "
We have included the fix for the issue "RichTextEditor in SfDialog Throws System.NullReferenceException on Close " with our package version 28.2.7. So, can you please upgrade your package to the latest to resolve the issue from your end?
Root cause: This issue occurs because the null condition is not checked for the Parent before accessing its childShouldRender property.
Regards
Bhuvaneshwari T

Loader.
Up arrow icon