fix NullPointerException on ack

This commit is contained in:
Naoyuki Kanezawa
2015-06-07 02:08:35 +09:00
parent 8df9cffbac
commit e9bf27a4ae

View File

@@ -344,9 +344,13 @@ public class Socket extends Emitter {
}
private void onack(Packet<JSONArray> packet) {
logger.fine(String.format("calling ack %s with %s", packet.id, packet.data));
Ack fn = this.acks.remove(packet.id);
if (fn != null) {
logger.fine(String.format("calling ack %s with %s", packet.id, packet.data));
fn.call(toArray(packet.data));
} else {
logger.fine(String.format("bad ack %s", packet.id));
}
}
private void onconnect() {