Add array length guard in TimeframesFilter timeFrameData computed

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 16:31:26 +08:00
parent 89dc327044
commit a6d32672bc

View File

@@ -135,6 +135,8 @@ const sliderData = computed(() => {
// Add the minimum and maximum values // Add the minimum and maximum values
const timeFrameData = computed(() => { const timeFrameData = computed(() => {
if (!filterTimeframe.value?.data || filterTimeframe.value.data.length < 10)
return [];
const data = filterTimeframe.value.data.map((i) => ({ x: i.x, y: i.y })); const data = filterTimeframe.value.data.map((i) => ({ x: i.x, y: i.y }));
// See ./public/timeFrameSlope for the y-axis slope calculation diagram // See ./public/timeFrameSlope for the y-axis slope calculation diagram
// x values are 0 ~ 11, // x values are 0 ~ 11,