Fix missing bounds checks, unsafe JSON.parse, and cleanup issues

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-09 13:56:47 +08:00
co-authored by Claude Opus 4.6
parent 48784010ad
commit 6141e70235
4 changed files with 22 additions and 12 deletions
+1 -1
View File
@@ -192,7 +192,7 @@ export const useMapPathStore = defineStore('mapPathStore', {
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
}
if (nodeIndex >= curButton[listIndex]) { // Bounds check to prevent out-of-range access
if (nodeIndex >= curButton[listIndex].length) { // Bounds check to prevent out-of-range access
return; // The node index within this path in the list
}
// If `curPath` and `curButton[listIndex]` fully match