diff options
Diffstat (limited to 'MediaBrowser.Server.Startup.Common/ApplicationHost.cs')
| -rw-r--r-- | MediaBrowser.Server.Startup.Common/ApplicationHost.cs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs index b554e0d1c..60ff36c6d 100644 --- a/MediaBrowser.Server.Startup.Common/ApplicationHost.cs +++ b/MediaBrowser.Server.Startup.Common/ApplicationHost.cs @@ -529,7 +529,7 @@ namespace MediaBrowser.Server.Startup.Common var sharingRepo = new SharingRepository(LogManager, ApplicationPaths); await sharingRepo.Initialize().ConfigureAwait(false); RegisterSingleInstance<ISharingManager>(new SharingManager(sharingRepo, ServerConfigurationManager, LibraryManager, this)); - + RegisterSingleInstance<ISsdpHandler>(new SsdpHandler(LogManager.GetLogger("SsdpHandler"), ServerConfigurationManager, this)); var activityLogRepo = await GetActivityLogRepository().ConfigureAwait(false); @@ -1088,15 +1088,24 @@ namespace MediaBrowser.Server.Startup.Common { get { - // Return the first matched address, if found, or the first known local address - var address = LocalIpAddress; + try + { + // Return the first matched address, if found, or the first known local address + var address = LocalIpAddress; - if (!string.IsNullOrWhiteSpace(address)) + if (!string.IsNullOrWhiteSpace(address)) + { + address = GetLocalApiUrl(address); + } + + return address; + } + catch (Exception ex) { - address = GetLocalApiUrl(address); + Logger.ErrorException("Error getting local Ip address information", ex); } - return address; + return null; } } |
