Skip to content

Commit

Permalink
fix: check if first argv is supplied before accessing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mirasaki committed Mar 6, 2023
1 parent f8da8a8 commit 156f3b5
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -250,7 +250,7 @@ if (USE_API === 'true') require('./server/');

// Exit before initializing listeners in test mode
const firstArg = process.argv[2];
if (firstArg.startsWith('mode=') && firstArg.endsWith('test')) process.exit(1);
if (firstArg && firstArg.startsWith('mode=') && firstArg.endsWith('test')) process.exit(1);

// Logging in to our client
client.login(DISCORD_BOT_TOKEN);

0 comments on commit 156f3b5

Please sign in to comment.