Fix exception on answering polls without an answer

This commit is contained in:
brenoepics 2022-03-07 01:46:12 +00:00 committed by Harmonic
parent 4b207a3993
commit aff5566451

View File

@ -21,12 +21,15 @@ public class AnswerPollEvent extends MessageHandler {
int pollId = this.packet.readInt();
int questionId = this.packet.readInt();
int count = this.packet.readInt();
String answers = this.packet.readString();
StringBuilder answer = new StringBuilder();
for (int i = 0; i < count; i++) {
answer.append(":").append(this.packet.readString());
answer.append(":").append(answers);
}
if(answer.length() <= 0) return;
if (pollId == 0 && questionId <= 0) {
this.client.getHabbo().getHabboInfo().getCurrentRoom().handleWordQuiz(this.client.getHabbo(), answer.toString());
return;