File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
assets/js/components/Forecast Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -163,7 +163,7 @@ export default defineComponent({
163163 order: active ? 0 : 1 ,
164164 });
165165 }
166- if (this .gridSlots .length > 0 ) {
166+ if (this .gridSlots && this . gridSlots .length > 0 ) {
167167 const active = this .selected === ForecastType .Price ;
168168 const color = active ? colors .price : colors .border ;
169169 datasets .push ({
@@ -184,7 +184,7 @@ export default defineComponent({
184184 order: active ? 0 : 1 ,
185185 });
186186 }
187- if (this .co2Slots .length > 0 ) {
187+ if (this .co2Slots && this . co2Slots .length > 0 ) {
188188 const active = this .selected === ForecastType .Co2 ;
189189 const color = active ? colors .co2 : colors .border ;
190190 datasets .push ({
@@ -427,6 +427,10 @@ export default defineComponent({
427427 this .startDate = now ;
428428 },
429429 filterSlots(slots : ForecastSlot [] = []) {
430+ if (! slots ) {
431+ return undefined ;
432+ }
433+
430434 return slots .filter (
431435 (slot ) =>
432436 new Date (slot .end ) >= this .startDate && new Date (slot .start ) <= this .endDate
You can’t perform that action at this time.
0 commit comments