Skip to content

Commit 50d2210

Browse files
committed
fix: add guards
1 parent e16c4d9 commit 50d2210

1 file changed

Lines changed: 6 additions & 0 deletions

File tree

app/components/Package/TimelineChart.vue

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ const activeVersionIndex = computed(() => {
9191
9292
const seriesTotalSize = computed(() => {
9393
const values = convertedData.value.map(d => d.totalSize)
94+
if (!values.length) {
95+
return { values, min: 0, max: 1 }
96+
}
9497
return {
9598
values,
9699
min: Math.min(...values),
@@ -100,6 +103,9 @@ const seriesTotalSize = computed(() => {
100103
101104
const seriesDependencies = computed(() => {
102105
const values = convertedData.value.map(d => d.dependencyCount)
106+
if (!values.length) {
107+
return { values, min: 0, max: 1 }
108+
}
103109
return {
104110
values,
105111
min: Math.min(...values),

0 commit comments

Comments
 (0)