diff --git a/src/Umbraco.Web/Editors/LogController.cs b/src/Umbraco.Web/Editors/LogController.cs index 30c2a33ff1..08a21a9364 100644 --- a/src/Umbraco.Web/Editors/LogController.cs +++ b/src/Umbraco.Web/Editors/LogController.cs @@ -83,13 +83,21 @@ namespace Umbraco.Web.Editors private IEnumerable MapAvatarsAndNames(IEnumerable items) { var userIds = items.Select(x => x.UserId).ToArray(); - var users = Services.UserService.GetUsersById(userIds) + var userAvatars = Services.UserService.GetUsersById(userIds) .ToDictionary(x => x.Id, x => x.GetUserAvatarUrls(ApplicationCache.RuntimeCache)); var userNames = Services.UserService.GetUsersById(userIds).ToDictionary(x => x.Id, x => x.Name); foreach (var item in items) - { - item.UserAvatars = users[item.UserId]; - item.UserName = userNames[item.UserId]; + { + if (userAvatars.TryGetValue(item.UserId, out var avatars)) + { + item.UserAvatars = avatars; + } + if (userNames.TryGetValue(item.UserId, out var name)) + { + item.UserName = name; + } + + } return items; }