Skip to content

Commit 5420721

Browse files
ArgoZhangwdmb123
andauthored
refactor(PopConfirmButton): add OnConfirm null check (#5898)
* refactor: 增加空检查 * chore: bump version 9.5.11-beta07 Co-Authored-By: lyt <[email protected]> --------- Co-authored-by: lyt <[email protected]>
1 parent eadd595 commit 5420721

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

src/BootstrapBlazor/BootstrapBlazor.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<Project Sdk="Microsoft.NET.Sdk.Razor">
22

33
<PropertyGroup>
4-
<Version>9.5.11-beta06</Version>
4+
<Version>9.5.11-beta07</Version>
55
</PropertyGroup>
66

77
<ItemGroup>

src/BootstrapBlazor/Components/Button/PopConfirmButton.razor.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,11 @@ private async Task OnClickConfirm()
9999
IsDisabled = true;
100100
IsAsyncLoading = true;
101101
StateHasChanged();
102-
await OnConfirm();
102+
103+
if (OnConfirm != null)
104+
{
105+
await OnConfirm();
106+
}
103107

104108
if (ButtonType == ButtonType.Submit)
105109
{

0 commit comments

Comments
 (0)