Skip to content

Commit

Permalink
Merge pull request #20010 from abpframework/uipageprogress
Browse files Browse the repository at this point in the history
Check if PageProgressRef is null
  • Loading branch information
maliming committed Jun 11, 2024
2 parents 9f733a7 + 444e0b7 commit 4311b55
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Volo.Abp.BlazoriseUI.Components;

public partial class UiPageProgress : ComponentBase, IDisposable
{
protected PageProgress PageProgressRef { get; set; } = default!;
protected PageProgress? PageProgressRef { get; set; }

protected int? Percentage { get; set; }

Expand All @@ -33,8 +33,11 @@ private async void OnProgressChanged(object? sender, UiPageProgressEventArgs e)
Visible = e.Percentage == null || (e.Percentage >= 0 && e.Percentage <= 100);
Color = GetColor(e.Options.Type);

await PageProgressRef.SetValueAsync(e.Percentage);

if(PageProgressRef != null)
{
await PageProgressRef.SetValueAsync(e.Percentage);
}

await InvokeAsync(StateHasChanged);
}

Expand Down

0 comments on commit 4311b55

Please sign in to comment.