From 8b1e3fe088078a3383a4acb9dd49b3970f1c5810 Mon Sep 17 00:00:00 2001 From: pavelbannov Date: Tue, 12 Mar 2024 18:26:51 +0300 Subject: [PATCH] Files: fixed null reference exception --- .../ASC.Files/Core/Services/DocumentService/Configuration.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/products/ASC.Files/Core/Services/DocumentService/Configuration.cs b/products/ASC.Files/Core/Services/DocumentService/Configuration.cs index 8a2c0155c7f..4934fccb4b7 100644 --- a/products/ASC.Files/Core/Services/DocumentService/Configuration.cs +++ b/products/ASC.Files/Core/Services/DocumentService/Configuration.cs @@ -333,7 +333,7 @@ public async IAsyncEnumerable GetRecent(FileType fileType, T fileI var folderDao = daoFactory.GetFolderDao(); var files = (await entryManager.GetRecentAsync(filter, false, Guid.Empty, string.Empty, null, false)) .Cast>() - .Where(file => !Equals(fileId, file.Id)) + .Where(file => file != null && !Equals(fileId, file.Id)) .ToList(); var parentIds = files.Select(r => r.ParentId).Distinct().ToList(); @@ -343,7 +343,7 @@ public async IAsyncEnumerable 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)) };