diff options
| author | Bond-009 <bond.009@outlook.com> | 2021-05-06 23:33:41 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-06 23:33:41 +0200 |
| commit | a4a3f598af92c7e62a920c4a2eb4f89081c13648 (patch) | |
| tree | 3c1ac92e2d348aaae53315c6a4caa02fbd7ba0d9 /Jellyfin.Api/Auth/BaseAuthorizationHandler.cs | |
| parent | ad1d9d9a23c4bff7a485a61fe41639a7d1b3491e (diff) | |
| parent | 4b9a64c18cff58938dab0c0770147a5e48c833f9 (diff) | |
Merge pull request #5982 from Bond-009/nullable
Diffstat (limited to 'Jellyfin.Api/Auth/BaseAuthorizationHandler.cs')
| -rw-r--r-- | Jellyfin.Api/Auth/BaseAuthorizationHandler.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs index 7d68aecf9..392498c53 100644 --- a/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs +++ b/Jellyfin.Api/Auth/BaseAuthorizationHandler.cs @@ -77,8 +77,9 @@ namespace Jellyfin.Api.Auth return false; } - var ip = _httpContextAccessor.HttpContext.GetNormalizedRemoteIp(); - var isInLocalNetwork = _networkManager.IsInLocalNetwork(ip); + var isInLocalNetwork = _httpContextAccessor.HttpContext != null + && _networkManager.IsInLocalNetwork(_httpContextAccessor.HttpContext.GetNormalizedRemoteIp()); + // User cannot access remotely and user is remote if (!user.HasPermission(PermissionKind.EnableRemoteAccess) && !isInLocalNetwork) { |
