Fix empty preset element in ONVIF response (#36182)

pull/36185/head
Jason Hunter 2020-05-27 00:16:15 -04:00 committed by GitHub
parent 0a6deeb49b
commit cb2821b512
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -297,7 +297,7 @@ class ONVIFDevice:
try:
ptz_service = self.device.create_ptz_service()
presets = await ptz_service.GetPresets(profile.token)
profile.ptz.presets = [preset.token for preset in presets]
profile.ptz.presets = [preset.token for preset in presets if preset]
except (Fault, ServerDisconnectedError):
# It's OK if Presets aren't supported
profile.ptz.presets = []