Null Pointer fix

This commit is contained in:
BaronGreenback 2021-03-10 19:27:22 +00:00
parent 5592967497
commit eafb8cf652

View file

@ -27,13 +27,13 @@ namespace Rssdp.Infrastructure
/// </summary>
public SsdpDeviceLocator(ISsdpCommunicationsServer communicationsServer)
{
if (communicationsServer == null)
{
throw new ArgumentNullException(nameof(communicationsServer));
}
_CommunicationsServer = communicationsServer;
_CommunicationsServer.ResponseReceived += CommsServer_ResponseReceived;
if (communicationsServer != null)
{
// This can occur is dlna is enabled, but defined to run over https.
_CommunicationsServer.ResponseReceived += CommsServer_ResponseReceived;
}
_Devices = new List<DiscoveredSsdpDevice>();
}