From dc7adbab2977b45202381e7d80c4e4e5a19f889f Mon Sep 17 00:00:00 2001 From: Alin Balutoiu Date: Mon, 29 Jan 2024 12:28:43 +0000 Subject: [PATCH] Fix nil panic --- octopus-energy-rates-card.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/octopus-energy-rates-card.js b/octopus-energy-rates-card.js index fa4c908..d3ce51e 100644 --- a/octopus-energy-rates-card.js +++ b/octopus-energy-rates-card.js @@ -131,7 +131,7 @@ class OctopusEnergyRatesCard extends HTMLElement { const pastEntityId = config.pastEntity; // Create an empty array to store the parsed attributes const allSlotsTargetTimes = []; - const targetTimesEntities = Object.keys(config.targetTimesEntities) || []; + const targetTimesEntities = config.targetTimesEntities && Object.keys(config.targetTimesEntities) || []; // Iterate through each entity in targetTimesEntities for (const entityId of targetTimesEntities) { const entityTimesState = hass.states[entityId];