From 85f269f3e63dfd710797da036666a818c93be705 Mon Sep 17 00:00:00 2001 From: Ray Greenwell Date: Thu, 26 Jun 2008 22:41:05 +0000 Subject: [PATCH] Totally reasonable fix, but this may break small things, so keep an eye out. If the arg specified is null, do not wrap it into an array! It prevents you from being able to call a function and falling back to the default value for the argument. Instead, only wrap non-null. If you really do want to pass null as your arg, you'll have to wrap it in an array. git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5197 542714f4-19e9-0310-aa3c-eee0fc999fb1 --- src/as/com/threerings/util/CommandEvent.as | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/as/com/threerings/util/CommandEvent.as b/src/as/com/threerings/util/CommandEvent.as index f237aa1e1..d4e558a34 100644 --- a/src/as/com/threerings/util/CommandEvent.as +++ b/src/as/com/threerings/util/CommandEvent.as @@ -41,7 +41,10 @@ public class CommandEvent extends Event var fn :Function = (cmdOrFn as Function); // build our args array var args :Array; - if (arg is Array) { + if (arg == null) { + args = null; + + } else if (arg is Array) { // if we were passed an array, treat it as the arg array. // Note: if you want to pass a single array param, you've // got to wrap it in another array, so sorry.