Freak out not if we have no client reference.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5912 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2009-08-14 21:36:13 +00:00
parent 04316d8620
commit ee4369df0f
@@ -28,6 +28,8 @@ import com.threerings.presents.net.AuthResponseData;
import com.threerings.presents.net.Message;
import com.threerings.presents.net.UpstreamMessage;
import static com.threerings.presents.Log.log;
/**
* Handles sending and receiving messages for the client.
*/
@@ -133,13 +135,19 @@ public abstract class Communicator
protected void notifyClientObservers (ObserverOps.Session op)
{
_client.notifyObservers(op);
if (_client != null) {
_client.notifyObservers(op);
} else {
log.warning("Dropping client notification. No observers.", "op", op);
}
}
protected void clientCleanup (Exception logonError)
{
_client.cleanup(logonError);
_client = null; // prevent any post-cleanup tomfoolery
if (_client != null) {
_client.cleanup(logonError);
_client = null; // prevent any post-cleanup tomfoolery
}
}
protected Client _client;