1
0
mirror of https://git.teknik.io/Teknikode/Teknik.git synced 2023-08-02 14:16:22 +02:00

Fixed issue where exception from user info was stopping showing results in admin search.

This commit is contained in:
Uncled1023 2017-07-02 18:47:48 -07:00
parent 0eb299ad88
commit 55bf97fe53

View File

@ -64,15 +64,22 @@ namespace Teknik.Areas.Admin.Controllers
{
foreach (Users.Models.User user in results)
{
SearchResultViewModel model = new SearchResultViewModel();
model.Username = user.Username;
if (Config.EmailConfig.Enabled)
try
{
model.Email = string.Format("{0}@{1}", user.Username, Config.EmailConfig.Domain);
SearchResultViewModel model = new SearchResultViewModel();
model.Username = user.Username;
if (Config.EmailConfig.Enabled)
{
model.Email = string.Format("{0}@{1}", user.Username, Config.EmailConfig.Domain);
}
model.JoinDate = user.JoinDate;
model.LastSeen = UserHelper.GetLastAccountActivity(db, Config, user);
models.Add(model);
}
catch (Exception ex)
{
// Skip this result
}
model.JoinDate = user.JoinDate;
model.LastSeen = UserHelper.GetLastAccountActivity(db, Config, user);
models.Add(model);
}
}