Add null guard for performanceData before accessing time properties

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-07 08:45:06 +08:00
parent ac00183096
commit 564ead23bf

View File

@@ -919,6 +919,10 @@ function getAvgWaitingTimeLineChart(chartData, content, yUnit) {
// 取得 Performance Data // 取得 Performance Data
await performanceStore.getPerformance(type, id); await performanceStore.getPerformance(type, id);
if(!performanceData.value?.time) {
isLoading.value = false;
return;
}
avgProcessTimeByTaskHeight.value = await getHorizontalBarHeight(performanceData.value.time.avg_process_time_by_task); avgProcessTimeByTaskHeight.value = await getHorizontalBarHeight(performanceData.value.time.avg_process_time_by_task);
if(performanceData.value.time.avg_waiting_time_by_edge !== null) { if(performanceData.value.time.avg_waiting_time_by_edge !== null) {
avgWaitingTimeByEdgeHeight.value = await getHorizontalBarHeight(performanceData.value.time.avg_waiting_time_by_edge); avgWaitingTimeByEdgeHeight.value = await getHorizontalBarHeight(performanceData.value.time.avg_waiting_time_by_edge);