From 1a32ea5886de62a495e6fcc65b3d270f9bd84cce Mon Sep 17 00:00:00 2001 From: stoned Date: Mon, 12 Aug 2024 13:24:42 +0200 Subject: [PATCH] fix evidebce off by one again --- webAO/packets/handlers/handleLE.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/webAO/packets/handlers/handleLE.ts b/webAO/packets/handlers/handleLE.ts index 2b7cfec4..7291cd64 100644 --- a/webAO/packets/handlers/handleLE.ts +++ b/webAO/packets/handlers/handleLE.ts @@ -11,6 +11,8 @@ import { prepChat, safeTags } from '../../encoding'; export const handleLE = (args: string[]) => { client.evidences = []; for (let i = 1; i < args.length; i++) { + if (!args[i].includes("&")) + break; const arg = args[i].split("&"); client.evidences[i - 1] = { name: prepChat(arg[0]), @@ -22,7 +24,7 @@ export const handleLE = (args: string[]) => { const evidence_box = document.getElementById("evidences"); evidence_box.innerHTML = ""; - for (let i = 0; i <= client.evidences.length; i++) { + for (let i = 0; i <= client.evidences.length-1; i++) { const evi_item = new Image(); evi_item.id = "evi_"+i; evi_item.className = "evi_icon"