diff options
| author | Joshua M. Boniface <joshua@boniface.me> | 2020-12-22 22:21:59 -0500 |
|---|---|---|
| committer | Joshua M. Boniface <joshua@boniface.me> | 2020-12-30 18:55:51 -0500 |
| commit | fbfb23ababaac71f7a33d2d7f90ecdd999268461 (patch) | |
| tree | 403a82c50c64ca52b7ca8e3894fb2b92817a28c4 | |
| parent | 622c71ce1ceeca0c70eeab2b1c1882cc685858c9 (diff) | |
Merge pull request #4850 from BaronGreenback/NetworkApiFix
Null reference fix
(cherry picked from commit bfdd4727b5e0d630d716f31700965b4d0760aa86)
Signed-off-by: Joshua M. Boniface <joshua@boniface.me>
| -rw-r--r-- | Jellyfin.Api/Controllers/SystemController.cs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/Jellyfin.Api/Controllers/SystemController.cs b/Jellyfin.Api/Controllers/SystemController.cs index 7784e8a11..d79bea985 100644 --- a/Jellyfin.Api/Controllers/SystemController.cs +++ b/Jellyfin.Api/Controllers/SystemController.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.ComponentModel.DataAnnotations; using System.IO; using System.Linq; +using System.Net; using System.Net.Mime; using System.Threading; using System.Threading.Tasks; @@ -66,7 +67,7 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status200OK)] public ActionResult<SystemInfo> GetSystemInfo() { - return _appHost.GetSystemInfo(Request.HttpContext.Connection.RemoteIpAddress); + return _appHost.GetSystemInfo(Request.HttpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback); } /// <summary> @@ -78,7 +79,7 @@ namespace Jellyfin.Api.Controllers [ProducesResponseType(StatusCodes.Status200OK)] public ActionResult<PublicSystemInfo> GetPublicSystemInfo() { - return _appHost.GetPublicSystemInfo(Request.HttpContext.Connection.RemoteIpAddress); + return _appHost.GetPublicSystemInfo(Request.HttpContext.Connection.RemoteIpAddress ?? IPAddress.Loopback); } /// <summary> |
