From 4fe12a043d428b10e41ec9ca562621575d40e659 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Fri, 11 Sep 2009 15:30:43 +0000 Subject: [PATCH] Even when fed an object graph with no loops we could have a stack overflow in our recursive checking. Try to catch it and cope. I have a bad feeling this won't actually work in some envs. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5950 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/ObjectMarshaller.as | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/src/as/com/threerings/util/ObjectMarshaller.as b/src/as/com/threerings/util/ObjectMarshaller.as index d9c6ceba6..f32fb9850 100644 --- a/src/as/com/threerings/util/ObjectMarshaller.as +++ b/src/as/com/threerings/util/ObjectMarshaller.as @@ -156,9 +156,19 @@ public class ObjectMarshaller public static function validateValue (value :Object) :void // throws ArgumentError { - var s :String = getValidationError(value); - if (s != null) { - throw new ArgumentError(s); + try { + var s :String = getValidationError(value); + if (s != null) { + throw new ArgumentError(s); + } + + } catch (e :Error) { + switch (e.errorID) { + case 1023: // stack overflow: oh well. Even if fed valid input this can happen. + break; + default: + throw e; // re-throw + } } }