diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs index 36eba6e..39c58de 100644 --- a/Project-Unite/ACL.cs +++ b/Project-Unite/ACL.cs @@ -113,7 +113,8 @@ public static IHtmlString UserLink(this HtmlHelper hpr, string userId) using(var db = new ApplicationDbContext()) { var usr = db.Users.Include(x=>x.Roles).FirstOrDefault(x => x.Id == userId); - + if (usr == null) + return hpr.Raw("system"); var userRoles = new List(); foreach (var usrRole in usr.Roles) {