Detect programmer error in delegate usage as early as possible and fail.

git-svn-id: svn+ssh://src.earth.threerings.net/narya/trunk@5223 542714f4-19e9-0310-aa3c-eee0fc999fb1
This commit is contained in:
Michael Bayne
2008-07-10 13:19:21 +00:00
parent 5baacc36da
commit 950fb6c4aa
2 changed files with 18 additions and 0 deletions
@@ -222,6 +222,7 @@ public abstract class PlaceController extends Controller
*/
protected void addDelegate (PlaceControllerDelegate delegate)
{
ratifyDelegate(delegate);
if (_delegates == null) {
_delegates = new ArrayList<PlaceControllerDelegate>();
}
@@ -266,6 +267,14 @@ public abstract class PlaceController extends Controller
}
}
/**
* Protects against programmer error.
*/
protected void ratifyDelegate (PlaceControllerDelegate delegate)
{
// nothing to do here, all PlaceControllerDelegates are safe for us
}
/** A reference to the active client context. */
protected CrowdContext _ctx;