mirror of
https://github.com/smogon/pokemon-showdown.git
synced 2026-09-14 12:15:44 -05:00
Info: Prevent crash in makecustomchallenge when user parameter is missing (#11296)
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled
Some checks failed
Node.js CI / build (18.x) (push) Has been cancelled
This commit is contained in:
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user