Merge branch 'fix-polls' into 'dev'

Fix exception on answering polls without an answer

See merge request morningstar/Arcturus-Community!482
This commit is contained in:
Harmonic 2022-03-07 01:46:12 +00:00
commit b587f865d8

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;