Commit 0f346591 authored by Adam Gausmann's avatar Adam Gausmann

Fix crashing when a server doesn't send a comment

parent 74e97468
Pipeline #5065520 passed with stages
in 17 seconds
......@@ -5,7 +5,7 @@
<parent>
<artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId>
<version>1.1</version>
<version>1.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -6,7 +6,7 @@
<groupId>ninja.nonemu</groupId>
<artifactId>samurai</artifactId>
<version>1.1</version>
<version>1.1.1</version>
<modules>
<module>api</module>
<module>runtime</module>
......
......@@ -5,7 +5,7 @@
<parent>
<artifactId>samurai</artifactId>
<groupId>ninja.nonemu</groupId>
<version>1.1</version>
<version>1.1.1</version>
</parent>
<modelVersion>4.0.0</modelVersion>
......
......@@ -59,7 +59,7 @@ public class ConnectionImpl implements Connection {
else if (message.getCommand().equalsIgnoreCase("PART")) {
String user = message.senderName();
String channel = message.getArg(0);
String comment = message.getArg(1);
String comment = message.getArgCount() > 1 ? message.getArg(1) : "No comment";
if (user.equalsIgnoreCase(getNickname())) {
bot.getEventSystem().dispatchEvent(new BotLeaveEvent(getChannel(channel), comment));
......@@ -84,13 +84,13 @@ public class ConnectionImpl implements Connection {
}
else if (message.getCommand().equalsIgnoreCase("QUIT")) {
String user = message.senderName();
String comment = message.getArg(0);
String comment = message.getArgCount() > 0 ? message.getArg(0) : "No comment";
bot.getEventSystem().dispatchEvent(new UserQuitEvent(getUser(user), comment));
}
else if (message.getCommand().equalsIgnoreCase("KILL")) {
String sender = message.senderName();
String user = message.getArg(0);
String comment = message.getArg(1);
String comment = message.getArgCount() > 1 ? message.getArg(1) : "No comment";
bot.getEventSystem().dispatchEvent(new UserKillEvent(getUser(sender),
getUser(user), comment));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment