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
Link to minimal reproduction or a simple code snippet
<MarkdownImageUploadChanged="ImageUploadChanged"></Markdown>
@code{privateasyncTaskImageUploadChanged(FileChangedEventArgsevents)
{try{varcount=events.Files.Length; // Prints always one foreach (varfileinevents.Files)
{usingvarmemoryStream=newMemoryStream();
awaitfile.WriteToStreamAsync(memoryStream);
}}catch (Exceptione)
{Console.WriteLine(e);
throw;
}}}
Steps to reproduce & bug description
Using the Markdown component in combination with uploading multiple files/images at once leads to a NullReferenceException.
The "odd" thing here is that events.Files.Length will always be one, independent of how many items you drag and drop onto the markdown field. That said, for each file dropped, the ImageUploadChanged will be invoked.
In a given scenario where you drop at least two or more files, await file.WriteToStreamAsync(memoryStream); will throw with the given exception.
What is expected?
Aside from the exception, that shouldn't throw. I think it would be more obvious for folks if it either follows more closely what InputFileChangeEventArgs is doing (aka GetMultipleFiles) or populate the array with all the items, rather than invoking the callback once per file.
What is actually happening?
NullReferenceException
The FileChangedEventArgs.Files array only consists of one item
What browsers do you see the problem on?
No response
Any additional comments?
Here the stack trace of the second invocation:
at Blazorise.RemoteFileEntryStreamReader.OpenReadStreamAsync(CancellationToken cancellationToken)
at Blazorise.RemoteFileEntryStreamReader.CopyFileDataIntoBuffer(Memory`1 destination, CancellationToken cancellationToken)
at Blazorise.RemoteFileEntryStreamReader.WriteToStreamAsync(Stream stream, CancellationToken cancellationToken)
at Blazorise.RemoteFileEntryStreamReader.WriteToStreamAsync(Stream stream, CancellationToken cancellationToken)
at Blazorise.FileEntry.WriteToStreamAsync(Stream stream, CancellationToken cancellationToken)
at Bug.Components.Pages.Home.ImageUploadChanged(FileChangedEventArgs events)
The text was updated successfully, but these errors were encountered:
Blazorise Version
1.7.3
What Blazorise provider are you running on?
Bootstrap5
Link to minimal reproduction or a simple code snippet
Steps to reproduce & bug description
Using the
Markdown
component in combination with uploading multiple files/images at once leads to aNullReferenceException
.The "odd" thing here is that
events.Files.Length
will always be one, independent of how many items you drag and drop onto the markdown field. That said, for each file dropped, theImageUploadChanged
will be invoked.In a given scenario where you drop at least two or more files,
await file.WriteToStreamAsync(memoryStream);
will throw with the given exception.What is expected?
Aside from the exception, that shouldn't throw. I think it would be more obvious for folks if it either follows more closely what
InputFileChangeEventArgs
is doing (akaGetMultipleFiles
) or populate the array with all the items, rather than invoking the callback once per file.What is actually happening?
NullReferenceException
FileChangedEventArgs.Files
array only consists of one itemWhat browsers do you see the problem on?
No response
Any additional comments?
Here the stack trace of the second invocation:
The text was updated successfully, but these errors were encountered: