Fixed the bug in #438 and added unit tests to make so we dont break it in the future

This commit is contained in:
tidusjar 2016-07-26 20:50:38 +01:00
parent 9d82add7ae
commit 4d85000753
5 changed files with 468 additions and 308 deletions

View file

@ -122,11 +122,11 @@ namespace PlexRequests.UI.Modules
{
get
{
if (Context.CurrentUser == null)
if (Context?.CurrentUser == null)
{
return false;
}
var claims = Context.CurrentUser.Claims.ToList();
var claims = Context?.CurrentUser.Claims.ToList();
return claims.Contains(UserClaims.Admin) || claims.Contains(UserClaims.PowerUser);
}
}