Skip to content

Commit

Permalink
Files: fixed null reference exception
Browse files Browse the repository at this point in the history
  • Loading branch information
pavelbannov committed Mar 12, 2024
1 parent 52de532 commit 8b1e3fe
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ public async IAsyncEnumerable<RecentConfig> GetRecent(FileType fileType, T fileI
var folderDao = daoFactory.GetFolderDao<int>();
var files = (await entryManager.GetRecentAsync(filter, false, Guid.Empty, string.Empty, null, false))
.Cast<File<int>>()
.Where(file => !Equals(fileId, file.Id))
.Where(file => file != null && !Equals(fileId, file.Id))
.ToList();

var parentIds = files.Select(r => r.ParentId).Distinct().ToList();
Expand All @@ -343,7 +343,7 @@ public async IAsyncEnumerable<RecentConfig> GetRecent(FileType fileType, T fileI
{
yield return new RecentConfig
{
Folder = parentFolders.Find(r => file.ParentId == r.Id).Title,
Folder = parentFolders.FirstOrDefault(r => file.ParentId == r.Id)?.Title,
Title = file.Title,
Url = baseCommonLinkUtility.GetFullAbsolutePath(filesLinkUtility.GetFileWebEditorUrl(file.Id))
};
Expand Down

0 comments on commit 8b1e3fe

Please sign in to comment.