summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Project-Unite/ACL.cs4
1 files changed, 2 insertions, 2 deletions
diff --git a/Project-Unite/ACL.cs b/Project-Unite/ACL.cs
index d85c896..aca67a5 100644
--- a/Project-Unite/ACL.cs
+++ b/Project-Unite/ACL.cs
@@ -29,8 +29,8 @@ namespace Project_Unite
{
userRoles.Add(db.Roles.FirstOrDefault(r => r.Id == usrRole.RoleId) as Role);
}
- var userRole = userRoles.OrderByDescending(m => m.Priority).First();
- return hpr.ActionLink(usr.DisplayName, "ViewProfile", "Profiles", new { name = usr.UserName }, new { style = @"color: " + userRole.ColorHex });
+ var userRole = userRoles.OrderByDescending(m => m.Priority).FirstOrDefault();
+ return hpr.ActionLink(usr.DisplayName, "ViewProfile", "Profiles", new { name = usr.UserName }, new { style = userRole == null ? "color:white;" : @"color: " + userRole.ColorHex });
}
}