Allow the handleCOMMAND functions to have no arg if the command's arg is null.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@4347 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Ray Greenwell
2006-08-29 01:06:06 +00:00
parent 83b9ce29d2
commit 8386957cbc
+12 -1
View File
@@ -46,7 +46,18 @@ public class Controller
var fn :Function = (this["handle" + cmd] as Function);
if (fn != null) {
try {
fn(arg);
try {
// try calling it with the arg
fn(arg);
} catch (ae :ArgumentError) {
if (arg == null) {
// try calling it without the arg
fn();
} else {
throw ae;
}
}
} catch (e :Error) {
var log :Log = Log.getLog(this);
log.warning("Error handling controller " +