From 8a4b6539b94537a9b163c7a6f0d171405dd99f32 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BE=9D=E7=91=AA=E8=B2=93?= Date: Mon, 9 Mar 2026 14:20:05 +0800 Subject: [PATCH] Add bounds check in highlightMostFrequentPath before array access Co-Authored-By: Claude Opus 4.6 --- src/stores/mapPathStore.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/stores/mapPathStore.ts b/src/stores/mapPathStore.ts index d65a406..8ff51a0 100644 --- a/src/stores/mapPathStore.ts +++ b/src/stores/mapPathStore.ts @@ -262,10 +262,12 @@ clearAllHighlight() { }, async highlightMostFrequentPath() { const LIST_INDEX = 0; - this.insightWithPath['most_freq_traces'][LIST_INDEX].nodes.forEach(nodeToHighlight => { + const traces = this.insightWithPath?.['most_freq_traces']; + if (!traces?.[LIST_INDEX]) return; + traces[LIST_INDEX].nodes.forEach(nodeToHighlight => { nodeToHighlight.data('nodeImageUrl', ImgCapsulesGlow[nodeToHighlight.data('level')]); }); - this.insightWithPath['most_freq_traces'][LIST_INDEX].edges.forEach(edgeToHighlight => + traces[LIST_INDEX].edges.forEach(edgeToHighlight => edgeToHighlight.addClass('highlight-edge')); }, setIsBPMNOn(isOn: boolean) {