Skip to content

Commit

Permalink
Merge pull request #67 from alinbalutoiu/main
Browse files Browse the repository at this point in the history
Fix nil panic
  • Loading branch information
lozzd authored Jan 29, 2024
2 parents 50d1f16 + dc7adba commit b72d491
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 b72d491

Please sign in to comment.