From f9b02d5cabe914a9a6fcc5ffbc29fec98a5a68c1 Mon Sep 17 00:00:00 2001 From: Paulus Schoutsen Date: Sun, 27 Feb 2022 12:04:22 -0800 Subject: [PATCH] Guard for index error in picnic (#67345) --- homeassistant/components/picnic/coordinator.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/homeassistant/components/picnic/coordinator.py b/homeassistant/components/picnic/coordinator.py index 773142a0109..9f387858e5f 100644 --- a/homeassistant/components/picnic/coordinator.py +++ b/homeassistant/components/picnic/coordinator.py @@ -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 {}, {}