Prevent error yk

This commit is contained in:
GregTCLTK 2020-02-26 17:05:13 +01:00
parent a6fe1d419f
commit 2535568163
No known key found for this signature in database
GPG key ID: A91BADE5C070FF67

View file

@ -56,7 +56,7 @@ public class RulesCommand implements Command {
try { try {
TextChannel channel = e1.getGuild().getTextChannelsByName(e1.getMessage().getContentRaw(), true).get(0); TextChannel channel = e1.getGuild().getTextChannelsByName(e1.getMessage().getContentRaw(), true).get(0);
createRules(e, e1, channel); createRules(e, e1, channel);
} catch (NullPointerException ex) { } catch (NullPointerException | IndexOutOfBoundsException ex) {
e.getTextChannel().sendMessage( e.getTextChannel().sendMessage(
e.getMessageEditor().getMessage( e.getMessageEditor().getMessage(
MessageEditor.MessageType.ERROR, MessageEditor.MessageType.ERROR,