Avoid NPE for final datagrams sent/received after client cleanup.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5975 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Andrzej Kapolka
2009-09-28 21:51:08 +00:00
parent 8cbc3fcf1a
commit dd15495810
@@ -447,8 +447,10 @@ public class BlockingCommunicator extends Communicator
_datagramChannel.write(buf); _datagramChannel.write(buf);
// notify the tracker // notify the tracker
if (_client != null) {
_client.getMessageTracker().messageSent(true, size, msg); _client.getMessageTracker().messageSent(true, size, msg);
} }
}
/** /**
* Reads a new message from the socket (blocking until a message has arrived). * Reads a new message from the socket (blocking until a message has arrived).
@@ -502,7 +504,9 @@ public class BlockingCommunicator extends Communicator
if (debugLogMessages()) { if (debugLogMessages()) {
log.info("DATAGRAM " + msg); log.info("DATAGRAM " + msg);
} }
if (_client != null) {
_client.getMessageTracker().messageReceived(true, size, msg); _client.getMessageTracker().messageReceived(true, size, msg);
}
return msg; return msg;
} catch (ClassNotFoundException cnfe) { } catch (ClassNotFoundException cnfe) {