mirror of
https://gitee.com/LongbowEnterprise/BootstrapBlazor.git
synced 2024-12-06 05:59:45 +08:00
!798 fix(#I2AMFB): throw NullReferenceException when enable Table AutoRefresh feature in debug mode
* fix: AutoRefreshCacheTokenSource is null
This commit is contained in:
parent
9d0de5675f
commit
b1f19f2531
@ -297,7 +297,7 @@ namespace BootstrapBlazor.Components
|
||||
// 自动刷新功能
|
||||
_ = Task.Run(async () =>
|
||||
{
|
||||
while (!AutoRefreshCancelTokenSource.IsCancellationRequested)
|
||||
while (!(AutoRefreshCancelTokenSource?.IsCancellationRequested ?? true))
|
||||
{
|
||||
await InvokeAsync(QueryAsync);
|
||||
await Task.Delay(AutoRefreshInterval, AutoRefreshCancelTokenSource.Token);
|
||||
@ -395,6 +395,7 @@ namespace BootstrapBlazor.Components
|
||||
{
|
||||
if (disposing)
|
||||
{
|
||||
AutoRefreshCancelTokenSource?.Cancel();
|
||||
AutoRefreshCancelTokenSource?.Dispose();
|
||||
AutoRefreshCancelTokenSource = null;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user