Prevent calling observers with a null client

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5538 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Jamie Doornbos
2008-11-11 18:43:29 +00:00
parent a0cc2fd348
commit 2014f8c906
@@ -211,9 +211,10 @@ public class BlockingCommunicator extends Communicator
log.info("Connection failed", ioe);
// let the client know that things went south
final Client client = _client;
notifyClientObservers(new ObserverOps.Client() {
protected void notify (ClientObserver obs) {
obs.clientConnectionFailed(_client, ioe);
obs.clientConnectionFailed(client, ioe);
}
});
@@ -267,9 +268,10 @@ public class BlockingCommunicator extends Communicator
log.debug("Writer thread exited.");
// let the client observers know that we're logged off
final Client client = _client;
notifyClientObservers(new ObserverOps.Session() {
protected void notify (SessionObserver obs) {
obs.clientDidLogoff(_client);
obs.clientDidLogoff(client);
}
});