Skip to content

Commit 11995c4

Browse files
committed
!3225 fix(#I5QH52): throw exception when not set UploaderElement in sub class of UploadBase
* fix: 修复子类未设置 UploaderElement 导致脚本报错问题
1 parent 9561196 commit 11995c4

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BootstrapBlazor/Components/Upload/UploadBase.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ protected override async Task OnAfterRenderAsync(bool firstRender)
6969
{
7070
await base.OnAfterRenderAsync(firstRender);
7171

72-
if (firstRender && !IsDisabled)
72+
if (firstRender && !IsDisabled && UploaderElement.Context != null)
7373
{
7474
// support drag
7575
Module = await JSRuntime.LoadModule("upload.js");
@@ -169,7 +169,7 @@ protected virtual IDictionary<string, object> GetUploadAdditionalAttributes()
169169
if (!string.IsNullOrEmpty(Capture))
170170
{
171171
ret.Add("capture", Capture);
172-
}
172+
}
173173
return ret;
174174
}
175175

0 commit comments

Comments
 (0)