From ba0ba7f659e07bb344a03c0634ba120006a85bc7 Mon Sep 17 00:00:00 2001 From: Mike Thomas Date: Thu, 9 Sep 2010 17:35:44 +0000 Subject: [PATCH] Instead of NPEing when we reset _oin at a bad time, let's throw an exception we can better handle and reduce some log spew. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6150 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../threerings/presents/client/BlockingCommunicator.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/java/com/threerings/presents/client/BlockingCommunicator.java b/src/java/com/threerings/presents/client/BlockingCommunicator.java index f3b989a38..9dcdf30e0 100644 --- a/src/java/com/threerings/presents/client/BlockingCommunicator.java +++ b/src/java/com/threerings/presents/client/BlockingCommunicator.java @@ -486,6 +486,12 @@ public class BlockingCommunicator extends Communicator // noop! } + if (_oin == null) { + // Our object input stream was taken away from us before we could do anything with the + // frame, this is equivalent to being interrupted mid-frame, so indicate that. + throw new InterruptedIOException(); + } + try { int size = _fin.available(); DownstreamMessage msg = (DownstreamMessage)_oin.readObject();