Add bounds check in highlightMostFrequentPath before array access

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 14:20:05 +08:00
parent 4f660ff08c
commit 8a4b6539b9

View File

@@ -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) {