From 730d448e40d215ffc92b386015fce329adc02e99 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 24 Sep 2009 19:35:35 +0000 Subject: [PATCH] As far as I can figure, ArrayMask objects are used even when the Array length is 0, so let's make sure we don't cause any streaming errors here. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5966 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/io/ArrayMask.as | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/as/com/threerings/io/ArrayMask.as b/src/as/com/threerings/io/ArrayMask.as index 2550659cf..466d8d46b 100644 --- a/src/as/com/threerings/io/ArrayMask.as +++ b/src/as/com/threerings/io/ArrayMask.as @@ -60,8 +60,11 @@ public class ArrayMask // documentation inherited from interface Streamable public function readFrom (ins :ObjectInputStream) :void { - _mask.length = ins.readShort(); - ins.readBytes(_mask, 0, _mask.length); + var len :int = ins.readShort(); + _mask.length = len; + if (len > 0) { + ins.readBytes(_mask, 0, len); + } } /** The array mask. */