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
This commit is contained in:
Ray Greenwell
2009-09-11 15:30:43 +00:00
parent f4ab06b619
commit 4fe12a043d
+13 -3
View File
@@ -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
}
}
}