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:
@@ -156,9 +156,19 @@ public class ObjectMarshaller
|
|||||||
public static function validateValue (value :Object) :void
|
public static function validateValue (value :Object) :void
|
||||||
// throws ArgumentError
|
// throws ArgumentError
|
||||||
{
|
{
|
||||||
var s :String = getValidationError(value);
|
try {
|
||||||
if (s != null) {
|
var s :String = getValidationError(value);
|
||||||
throw new ArgumentError(s);
|
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
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user