Guard against empty ssdp locations (#43156)
parent
91f265dd93
commit
c37c0da191
|
@ -92,7 +92,10 @@ class Scanner:
|
|||
|
||||
entries_to_process.append(entry)
|
||||
|
||||
if entry.location not in self._description_cache:
|
||||
if (
|
||||
entry.location is not None
|
||||
and entry.location not in self._description_cache
|
||||
):
|
||||
unseen_locations.add(entry.location)
|
||||
|
||||
if not entries_to_process:
|
||||
|
|
|
@ -10,7 +10,7 @@ from homeassistant.components import ssdp
|
|||
from tests.common import mock_coro
|
||||
|
||||
|
||||
async def test_scan_match_st(hass):
|
||||
async def test_scan_match_st(hass, caplog):
|
||||
"""Test matching based on ST."""
|
||||
scanner = ssdp.Scanner(hass, {"mock-domain": [{"st": "mock-st"}]})
|
||||
|
||||
|
@ -38,6 +38,7 @@ async def test_scan_match_st(hass):
|
|||
ssdp.ATTR_SSDP_SERVER: "mock-server",
|
||||
ssdp.ATTR_SSDP_EXT: "",
|
||||
}
|
||||
assert "Failed to fetch ssdp data" not in caplog.text
|
||||
|
||||
|
||||
@pytest.mark.parametrize(
|
||||
|
|
Loading…
Reference in New Issue