From c71b5b60d0dd751e1774d59f39c7fb8f391f9aac Mon Sep 17 00:00:00 2001 From: fros4943 Date: Fri, 19 Mar 2010 12:34:03 +0000 Subject: [PATCH] minor bugfix: cause may be null --- tools/cooja/java/se/sics/cooja/GUI.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/tools/cooja/java/se/sics/cooja/GUI.java b/tools/cooja/java/se/sics/cooja/GUI.java index c531be0ca..b5c360cfe 100644 --- a/tools/cooja/java/se/sics/cooja/GUI.java +++ b/tools/cooja/java/se/sics/cooja/GUI.java @@ -24,7 +24,7 @@ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * - * $Id: GUI.java,v 1.165 2010/03/19 11:32:59 fros4943 Exp $ + * $Id: GUI.java,v 1.166 2010/03/19 12:34:03 fros4943 Exp $ */ package se.sics.cooja; @@ -1651,13 +1651,13 @@ public class GUI extends Observable { GUI.showErrorDialog(GUI.getTopParentContainer(), "Error when starting plugin", ex, false); } else { /* If the plugin requires visualization, inform user */ - Throwable cause = ex.getCause(); + Throwable cause = ex; do { if (cause instanceof PluginRequiresVisualizationException) { logger.info("Visualized plugin was not started: " + pluginClass); return null; } - } while ((cause=cause.getCause()) != null); + } while (cause != null && (cause=cause.getCause()) != null); logger.fatal("Error when starting plugin", ex); }