diff --git a/src/App/Services/TokenService.cs b/src/App/Services/TokenService.cs index b9d2a2977..625c9cf77 100644 --- a/src/App/Services/TokenService.cs +++ b/src/App/Services/TokenService.cs @@ -93,10 +93,10 @@ namespace Bit.App.Services public bool TokenExpired => DateTime.UtcNow < TokenExpiration; public TimeSpan TokenTimeRemaining => TokenExpiration - DateTime.UtcNow; public bool TokenNeedsRefresh => TokenTimeRemaining.TotalMinutes < 5; - public string TokenUserId => DecodeToken()?["sub"].Value(); - public string TokenEmail => DecodeToken()?["email"].Value(); - public string TokenName => DecodeToken()?["name"].Value(); - public bool TokenPremium => (DecodeToken()?["premium"].Value()).GetValueOrDefault(false); + public string TokenUserId => DecodeToken()?["sub"]?.Value(); + public string TokenEmail => DecodeToken()?["email"]?.Value(); + public string TokenName => DecodeToken()?["name"]?.Value(); + public bool TokenPremium => DecodeToken()?["premium"]?.Value() ?? false; public string RefreshToken {