Guard for index error in picnic (#67345)

pull/67348/head
Paulus Schoutsen 2022-02-27 12:04:22 -08:00 committed by GitHub
parent e0172cb8da
commit f9b02d5cab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -112,7 +112,7 @@ class PicnicUpdateCoordinator(DataUpdateCoordinator):
next_delivery = (
copy.deepcopy(next_deliveries[-1]) if next_deliveries else {}
)
last_order = copy.deepcopy(deliveries[0])
last_order = copy.deepcopy(deliveries[0]) if deliveries else {}
except (KeyError, TypeError):
# A KeyError or TypeError indicate that the response contains unexpected data
return {}, {}