Skip to content

Commit 844230e

Browse files
committed
refactor: 更新 avatar 组件验证逻辑
1 parent 352da6b commit 844230e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/BootstrapBlazor/Components/Upload/AvatarUpload.razor.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -140,12 +140,12 @@ protected override void OnParametersSet()
140140

141141
private string? GetValidStatus(UploadFile? item = null)
142142
{
143-
if (item == null || IsDisabled || ValidateForm == null)
143+
if (IsDisabled || ValidateForm == null)
144144
{
145145
return null;
146146
}
147147

148-
var state = item.IsValid;
148+
var state = item?.IsValid ?? IsValid;
149149
return state.HasValue
150150
? state.Value ? "is-valid" : "is-invalid"
151151
: null;

0 commit comments

Comments
 (0)