Skip to content

Commit 8abc46a

Browse files
authored
fix: initialize next_arg with an empty string if match[2] is undefined to prevent errors. (#740)
1 parent 6df0ea1 commit 8abc46a

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

bot/middleware/commands.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ const commandArgs = () => (ctx: CommunityContext, next: () => void) => {
1313
if (match[1]) {
1414
command = match[1];
1515
}
16-
let next_arg = ['', '', match[2]];
16+
let next_arg = ['', '', match[2] || ''];
1717
while ((next_arg = re_next_arg.exec(next_arg[2])!)) {
1818
let quoted_arg = next_arg[1];
1919
let unquoted_arg = '';

0 commit comments

Comments
 (0)