diff --git a/AsbCloudInfrastructure/Services/FileService.cs b/AsbCloudInfrastructure/Services/FileService.cs index a036908b..b5103589 100644 --- a/AsbCloudInfrastructure/Services/FileService.cs +++ b/AsbCloudInfrastructure/Services/FileService.cs @@ -106,10 +106,8 @@ namespace AsbCloudInfrastructure.Services foreach (var item in entities) { var filePropertiesDto = item.Adapt(); - 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); }