You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
After upgrading to 5.0.12 (from 5.0.11) exporting a grid fails with the following error:
[2024-05-30T13:21:44.621Z] Error: System.ArgumentNullException: Value cannot be null. (Parameter 'source')
at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
at System.Linq.Enumerable.Where[TSource](IEnumerable`1 source, Func`2 predicate)
at GridBlazor.ExcelCell.RemoveInvalidXmlChars(String content)
at GridBlazor.ExcelCell.set_Content(String value)
at GridBlazor.ExcelCell..ctor(String value, Type type)
at GridBlazor.ExcelWriter.GenerateExcel[T](IGridColumnCollection`1 columns, IEnumerable`1 items)
at GridBlazor.CGrid`1.DownloadExcel(IJSRuntime js, String filename)
at GridBlazor.Pages.GridComponent`1.ExcelHandler()
at Microsoft.AspNetCore.Components.ComponentBase.CallStateHasChangedOnAsyncCompletion(Task task)
at Microsoft.AspNetCore.Components.RenderTree.Renderer.GetErrorHandledTask(Task taskToHandle, ComponentState owningComponentState)
To Reproduce
I am trying to make a small repro which shows the issue, but did not succeed yet.
But my project has this issue in version 5.0.12, but export works normally in 5.0.11 and below.
Looking into the GridBlazor code changes for 5.0.12 I wonder if the change (RemoveAndInvalidXmlChars) takes into account when the given string is null.
Calling LINQ Where() on a null value also provides an exception.
Expected behavior
Exporting a grid should result in a Excel file (and not an exception).
Possible Fix
Adding a conditional null operator (?) on content variable prevents this.
After upgrading to 5.0.12 (from 5.0.11) exporting a grid fails with the following error:
To Reproduce
I am trying to make a small repro which shows the issue, but did not succeed yet.
But my project has this issue in version 5.0.12, but export works normally in 5.0.11 and below.
Looking into the GridBlazor code changes for 5.0.12 I wonder if the change (RemoveAndInvalidXmlChars) takes into account when the given string is null.
Calling LINQ Where() on a null value also provides an exception.
Expected behavior
Exporting a grid should result in a Excel file (and not an exception).
Possible Fix
Adding a conditional null operator (?) on content variable prevents this.
Desktop:
The text was updated successfully, but these errors were encountered: