Skip to content

Commit e3eea29

Browse files
committed
Add try catch
1 parent e4a04ae commit e3eea29

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

Tevling/Pages/Statistics.razor.cs

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -95,10 +95,17 @@ await _module.InvokeVoidAsync(
9595

9696
public async ValueTask DisposeAsync()
9797
{
98-
if (_module != null)
98+
try
9999
{
100-
await _module.DisposeAsync();
101-
_module = null;
100+
if (_module != null)
101+
{
102+
await _module.DisposeAsync();
103+
_module = null;
104+
}
105+
}
106+
catch (JSDisconnectedException)
107+
{
108+
// Ignore, happens during page reload.
102109
}
103110
}
104111
}

0 commit comments

Comments
 (0)