From 871cc2eb63d3a1917fe0d261167e2ec4f999fbf2 Mon Sep 17 00:00:00 2001 From: Andrzej Kapolka Date: Mon, 24 Jan 2011 23:41:29 +0000 Subject: [PATCH] Avoid a ClassCastException when we transfer a marshaller from client to server (as we sometimes do when we transfer a player between peers in Project X). Technically we probably shouldn't be streaming the marshallers in that case, but doing this (and clearing the marshaller on the receiving end) is simpler than clearing, streaming, and restoring; or settings things up so that the marshaller is specifically excluded from streaming in transfers. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6467 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../com/threerings/presents/data/InvocationMarshaller.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/threerings/presents/data/InvocationMarshaller.java b/src/main/java/com/threerings/presents/data/InvocationMarshaller.java index 995523be2..dd0bfbd3a 100644 --- a/src/main/java/com/threerings/presents/data/InvocationMarshaller.java +++ b/src/main/java/com/threerings/presents/data/InvocationMarshaller.java @@ -256,7 +256,9 @@ public class InvocationMarshaller throws IOException, ClassNotFoundException { in.defaultReadObject(); - _invdir = ((ClientObjectInputStream)in).client.getInvocationDirector(); + if (in instanceof ClientObjectInputStream) { + _invdir = ((ClientObjectInputStream)in).client.getInvocationDirector(); + } } @Override