From 303ef44a189a120f956eb020858d5b5483aa4b69 Mon Sep 17 00:00:00 2001 From: Michael Date: Tue, 4 Apr 2017 18:54:59 -0400 Subject: [PATCH] Patch ACL.UserLink Assume system user if no user matching the ID was found. --- Project-Unite/ACL.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) 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) {