Skip to content

Commit

Permalink
Fix nil panic
Browse files Browse the repository at this point in the history
  • Loading branch information
alinbalutoiu committed Jan 29, 2024
1 parent 50d1f16 commit dc7adba
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion octopus-energy-rates-card.js
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand Down

0 comments on commit dc7adba

Please sign in to comment.