From 363f548f132b7f330e91782bfcd7ba1273e34ad0 Mon Sep 17 00:00:00 2001 From: Zack Arnett Date: Sun, 16 Feb 2020 18:19:28 -0500 Subject: [PATCH] fix error (#4885) --- src/panels/lovelace/cards/hui-sensor-card.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/panels/lovelace/cards/hui-sensor-card.ts b/src/panels/lovelace/cards/hui-sensor-card.ts index 800b0d98e2..7452cdb845 100644 --- a/src/panels/lovelace/cards/hui-sensor-card.ts +++ b/src/panels/lovelace/cards/hui-sensor-card.ts @@ -90,7 +90,7 @@ const calcPoints = ( let last = [average(first), lastValue(first)]; const getCoords = (item, i, offset = 0, depth = 1) => { - if (depth > 1) { + if (depth > 1 && item) { return item.forEach((subItem, index) => getCoords(subItem, i, index, depth - 1) );