mirror of
https://github.com/home-assistant/core.git
synced 2025-04-23 08:47:57 +00:00
Guard against empty ssdp locations (#43156)
This commit is contained in:
parent
96641cab02
commit
4907996dd6
@ -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…
x
Reference in New Issue
Block a user