Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
All items in dispose will fail if the circuit is closed. Wrap the try…
…/catch around all items.
  • Loading branch information
StevenRasmussen committed Apr 1, 2025
commit aaedb4533fd53df90401606eb028184d2df1307f
19 changes: 9 additions & 10 deletions src/Core/Components/InputFile/FluentInputFile.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public partial class FluentInputFile : FluentComponentBase, IAsyncDisposable
private ElementReference? _containerElement;
private InputFile? _inputFile;
private IJSObjectReference? _containerInstance;

public static string ResourceLoadingBefore = "Loading...";
public static string ResourceLoadingCompleted = "Completed";
public static string ResourceLoadingCanceled = "Canceled";
Expand Down Expand Up @@ -427,23 +427,22 @@ private async Task UpdateProgressAsync(int percent, string title)
// Unregister the drop zone events
public async ValueTask DisposeAsync()
{
if (_containerInstance != null)
try
{
try
if (_containerInstance != null)
{
await _containerInstance.InvokeVoidAsync("dispose");
await _containerInstance.DisposeAsync();
}
catch (JSDisconnectedException)

if (Module != null)
{
// Swallow. See: https://stackoverflow.com/questions/72488563/blazor-server-side-application-throwing-system-invalidoperationexception-javas
await Module.DisposeAsync();
}

await _containerInstance.DisposeAsync();
}

if (Module != null)
catch (JSDisconnectedException)
{
await Module.DisposeAsync();
// Swallow. See: https://stackoverflow.com/questions/72488563/blazor-server-side-application-throwing-system-invalidoperationexception-javas
}
}
}
Loading