fix: 修正file为空捕获

This commit is contained in:
橙子
2024-12-26 23:02:10 +08:00
parent 0184015ba8
commit 4b0b0e4451

View File

@@ -38,7 +38,7 @@ namespace Yi.Framework.Rbac.Application.Services
public async Task<IActionResult> Get([FromRoute] Guid code, [FromRoute] bool? isThumbnail)
{
var file = await _repository.GetAsync(x => x.Id == code);
var path = file.GetQueryFileSavePath(isThumbnail);
var path = file?.GetQueryFileSavePath(isThumbnail);
if (path is null || !File.Exists(path))
{
return new NotFoundResult();