From 1c70c9b3aff87d1e99fca53b12cd81105f48347b 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 18:40:54 +0800 Subject: [PATCH] Return false instead of undefined in depthFirstSearchMatchTwoPaths bounds checks Co-Authored-By: Claude Opus 4.6 --- src/stores/mapPathStore.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/stores/mapPathStore.ts b/src/stores/mapPathStore.ts index cccb723..7c7479c 100644 --- a/src/stores/mapPathStore.ts +++ b/src/stores/mapPathStore.ts @@ -193,10 +193,10 @@ export const useMapPathStore = defineStore('mapPathStore', { }, depthFirstSearchMatchTwoPaths(curPath, curPathIndex, curButton, listIndex, nodeIndex) { if (listIndex >= curButton.length) { // Bounds check to prevent out-of-range access - return; // nodeIndex is the path index in the list after selecting one of the five buttons + return false; // nodeIndex is the path index in the list after selecting one of the five buttons } if (nodeIndex >= curButton[listIndex].length) { // Bounds check to prevent out-of-range access - return; // The node index within this path in the list + return false; // The node index within this path in the list } // If `curPath` and `curButton[listIndex]` fully match if (curPathIndex === curPath.length || nodeIndex === curButton[listIndex].length) { @@ -205,7 +205,7 @@ export const useMapPathStore = defineStore('mapPathStore', { // Bounds check to prevent out-of-range access if (curPathIndex >= curPath.length || nodeIndex >= curButton[listIndex].length) { - return; + return false; } const nodeLabel = curPath[curPathIndex].data('label');