Crash endgueltig ausschliessen: keine Element-Destrukturierung mehr
Summenzeile (VerbrauchCharts) und Balken-Einfaerbung (BarChart) greifen die Werte jetzt per Index mit Array.isArray-Guard ab, statt Elemente per [x,y] zu destrukturieren. Damit kann "(destructured parameter) is not iterable" auch bei unerwarteten Datenelementen nicht mehr auftreten. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -91,9 +91,11 @@ export default function BarChart({
|
||||
// markierte Balken (z.B. Ladetage) bekommen eine eigene Farbe
|
||||
data:
|
||||
highlight && highlight.size
|
||||
? data.map(([x, y]) =>
|
||||
highlight.has(x) ? { x, y, color: highlightColor } : { x, y }
|
||||
)
|
||||
? data.map((p) => {
|
||||
const x = Array.isArray(p) ? p[0] : 0;
|
||||
const y = Array.isArray(p) ? p[1] : 0;
|
||||
return highlight.has(x) ? { x, y, color: highlightColor } : { x, y };
|
||||
})
|
||||
: data,
|
||||
color,
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user