Skip to content

Commit 350fef2

Browse files
authored
Handle missing snapshot URI (#81)
1 parent 2fd5430 commit 350fef2

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

onvif/client.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -543,7 +543,9 @@ async def get_snapshot_uri(self, profile_token: str) -> str:
543543
else:
544544
try:
545545
uri = normalize_url(result.Uri)
546-
except KeyError:
546+
except (AttributeError, KeyError):
547+
# AttributeError is raised when result.Uri is missing
548+
# https://github.com/home-assistant/core/issues/135494
547549
logger.warning(
548550
"%s: The device returned an invalid snapshot URI", self.host
549551
)

0 commit comments

Comments
 (0)