From e716ef1aba33c81028d14f5e2da352d11fffd03f Mon Sep 17 00:00:00 2001 From: Dieter Reinert Date: Thu, 24 Jul 2025 18:00:40 +0200 Subject: [PATCH] Info: Prevent crash in makecustomchallenge when user parameter is missing (#11296) --- server/chat-commands/info.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/server/chat-commands/info.ts b/server/chat-commands/info.ts index 78c1f6a3db..ac485c77dc 100644 --- a/server/chat-commands/info.ts +++ b/server/chat-commands/info.ts @@ -2862,12 +2862,15 @@ export const commands: Chat.ChatCommands = { const args = Chat.parseArguments(target, ' | ', { allowEmpty: true, useIDs: false, }); + if (!args.format?.[0]) { + return this.popupReply(`No format specified.`); + } const format = Dex.formats.get(toID(args.format[0])); if (format.effectType !== 'Format') { return this.popupReply(`The format '${format}' does not exist.`); } delete args.format; - const targetUserID = toID(args.user[0]); + const targetUserID = toID(args.user?.[0] || ''); if (targetUserID) { this.checkChat(); if (!Users.get(targetUserID)) {