From 8e4c52b224f19bf8b0f8bfc5a5785f92a41357ac Mon Sep 17 00:00:00 2001 From: shaper Date: Sun, 7 Apr 2002 21:59:25 +0000 Subject: [PATCH] Sanity check the results of getController(). git-svn-id: https://samskivert.googlecode.com/svn/trunk@695 6335cc39-0255-0410-8fd6-9bcaacd3b74c --- .../src/java/com/samskivert/swing/Controller.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/projects/samskivert/src/java/com/samskivert/swing/Controller.java b/projects/samskivert/src/java/com/samskivert/swing/Controller.java index c0cde96a..21f3001f 100644 --- a/projects/samskivert/src/java/com/samskivert/swing/Controller.java +++ b/projects/samskivert/src/java/com/samskivert/swing/Controller.java @@ -1,5 +1,5 @@ // -// $Id: Controller.java,v 1.11 2002/03/21 00:53:38 mdb Exp $ +// $Id: Controller.java,v 1.12 2002/04/07 21:59:25 shaper Exp $ // // samskivert library - useful routines for java programs // Copyright (C) 2001 Michael Bayne @@ -325,6 +325,12 @@ public abstract class Controller if (source instanceof ControllerProvider) { Controller ctrl = ((ControllerProvider)source).getController(); + if (ctrl == null) { + Log.warning("Provider returned null controller " + + "[provider=" + source + "]."); + continue; + } + try { // if the controller returns true, it handled the // action and we can call this business done