From 6aeee405494273d2b732acffdde8b0d3b4568444 Mon Sep 17 00:00:00 2001 From: "J. Nick Koston" Date: Fri, 17 Jan 2025 16:11:29 -1000 Subject: [PATCH] Handle missing snapshot URI https://github.com/home-assistant/core/issues/135494 --- onvif/client.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/onvif/client.py b/onvif/client.py index f479c4d..093d732 100644 --- a/onvif/client.py +++ b/onvif/client.py @@ -543,7 +543,9 @@ async def get_snapshot_uri(self, profile_token: str) -> str: else: try: uri = normalize_url(result.Uri) - except KeyError: + except (AttributeError, KeyError): + # AttributeError is raised when result.Uri is missing + # https://github.com/home-assistant/core/issues/135494 logger.warning( "%s: The device returned an invalid snapshot URI", self.host )