diff --git a/performance-test/frontend/src/business/report/components/MonitorCard.vue b/performance-test/frontend/src/business/report/components/MonitorCard.vue index 28f39ee561..cf3f254ae8 100644 --- a/performance-test/frontend/src/business/report/components/MonitorCard.vue +++ b/performance-test/frontend/src/business/report/components/MonitorCard.vue @@ -187,7 +187,7 @@ export default { if (currentInstance) { this.currentInstance = currentInstance; } else { - this.currentInstance = this.currentInstance || this.instances[0].ip + ":" + this.instances[0].port; + this.currentInstance = this.currentInstance || this.instances[0]?.ip + ":" + this.instances[0]?.port; } this.handleChecked(this.currentInstance); getSharePerformanceMetricQuery(this.shareId, this.id) @@ -210,7 +210,7 @@ export default { this.showChart = true; }); } else { - this.currentInstance = this.currentInstance || this.instances[0].ip + ":" + this.instances[0].port; + this.currentInstance = this.currentInstance || this.instances[0]?.ip + ":" + this.instances[0]?.port; } this.handleChecked(this.currentInstance); getPerformanceMetricQuery(this.id).then(result => { diff --git a/test-track/frontend/src/business/plan/view/comonents/report/detail/load/MonitorCard.vue b/test-track/frontend/src/business/plan/view/comonents/report/detail/load/MonitorCard.vue index 6466cf2cd6..be6d2db55c 100644 --- a/test-track/frontend/src/business/plan/view/comonents/report/detail/load/MonitorCard.vue +++ b/test-track/frontend/src/business/plan/view/comonents/report/detail/load/MonitorCard.vue @@ -171,7 +171,7 @@ export default { // this.init = true; if (this.planReportTemplate) { this.instances = this.planReportTemplate.reportResource; - this.currentInstance = currentInstance || this.instances[0].ip + ":" + this.instances[0].port; + this.currentInstance = currentInstance || this.instances[0]?.ip + ":" + this.instances[0]?.port; this.data = this.planReportTemplate.metricData; this.totalOption = this.getOption(this.currentInstance); }