From eb37356f0c51f909b73828baef8bb030ad8ce737 Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Fri, 1 Apr 2011 22:19:06 +0000 Subject: [PATCH] I'm not sure what's worse, a weird extra constructor for use when unserializing, or a weird alternative code path in the main constructor when unserializing. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@6576 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- .../java/com/threerings/crowd/data/OccupantInfo.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/main/java/com/threerings/crowd/data/OccupantInfo.java b/src/main/java/com/threerings/crowd/data/OccupantInfo.java index 095c33bfb..852decf72 100644 --- a/src/main/java/com/threerings/crowd/data/OccupantInfo.java +++ b/src/main/java/com/threerings/crowd/data/OccupantInfo.java @@ -89,7 +89,7 @@ public class OccupantInfo extends SimpleStreamableObject } /** The body object id of this occupant (and our entry key). */ - public final Integer bodyOid; + public Integer bodyOid; /** The username of this occupant. */ public Name username; @@ -102,9 +102,11 @@ public class OccupantInfo extends SimpleStreamableObject */ public OccupantInfo (BodyObject body) { - bodyOid = Integer.valueOf(body.getOid()); - username = body.getVisibleName(); - status = body.status; + if (body != null) { // body is null when unserializing + bodyOid = Integer.valueOf(body.getOid()); + username = body.getVisibleName(); + status = body.status; + } } /** Access to the body object id as an int. */