[reputation] fix top fails when user left chat

This commit is contained in:
West14
2022-05-07 18:07:08 +03:00
parent 5eec35ba7d
commit 0aea2fac42
+11 -1
View File
@@ -159,7 +159,17 @@ public class Reputation : CommonHandler
var i = 1;
foreach (var rep in await _reputationService.GetChatRatingAsync(Chat))
{
var user = await _userService.GetUser(rep.UserId, rep.ChatId);
// TODO: there are should be more correct fix, but I want to fix this now, West, 18:04, 07.05.2022
User user;
try
{
user = await _userService.GetUser(rep.UserId, rep.ChatId);
}
catch
{
continue;
}
msg.Text($"{i}. ")
.Text($"{user.FirstName} {user.LastName}".Trim().HtmlEncode())
.Text($" ({rep.Value})").Br();