Merge pull request #3392 from sbwalker/dev

resolve null reference exception in FileManager when ShowFiles = false
This commit is contained in:
Shaun Walker 2023-10-17 15:12:06 -04:00 committed by GitHub
commit c7f8737eeb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -42,7 +42,7 @@
}
else
{
if (GetFileId() != -1 && !UploadMultiple)
if (FileId != -1 && _file != null && !UploadMultiple)
{
<input class="form-control" @bind="@_file.Name" disabled />
}
@ -62,7 +62,7 @@
</div>
<div class="col mt-2 text-end">
<button type="button" class="btn btn-success" @onclick="UploadFiles">@SharedLocalizer["Upload"]</button>
@if (GetFileId() != -1 && !UploadMultiple)
@if (FileId != -1 && !UploadMultiple)
{
<button type="button" class="btn btn-danger mx-1" @onclick="DeleteFile">@SharedLocalizer["Delete"]</button>
}