fixed nullReference in mapping filePropertiesDto

This commit is contained in:
Фролов 2021-08-20 13:56:20 +05:00
parent fbff8e986a
commit 6db671f955

View File

@ -106,10 +106,8 @@ namespace AsbCloudInfrastructure.Services
foreach (var item in entities)
{
var filePropertiesDto = item.Adapt<FileInfoDto>();
filePropertiesDto.AuthorName = item.Author.Name;
filePropertiesDto.CompanyId = item.Author.IdCompany != null
? item.Author.Company.Id
: 0;
filePropertiesDto.AuthorName = item.Author?.Name;
filePropertiesDto.CompanyId = item.Author?.IdCompany ?? 0;
result.Items.Add(filePropertiesDto);
}