From c6bc0bf79bad4358017011687bad3214546b42d4 Mon Sep 17 00:00:00 2001 From: "PSp..om" Date: Sun, 26 Aug 2012 17:42:36 +0000 Subject: [PATCH] Added a null listener check just to help track down odd errors. git-svn-id: https://jmonkeyengine.googlecode.com/svn/trunk@9689 75d07b2b-3a1a-0410-a2c5-0572b91ccdca --- .../com/jme3/network/base/MessageListenerRegistry.java | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/engine/src/networking/com/jme3/network/base/MessageListenerRegistry.java b/engine/src/networking/com/jme3/network/base/MessageListenerRegistry.java index f99342f83..cf9074bc0 100644 --- a/engine/src/networking/com/jme3/network/base/MessageListenerRegistry.java +++ b/engine/src/networking/com/jme3/network/base/MessageListenerRegistry.java @@ -96,6 +96,8 @@ public class MessageListenerRegistry implements MessageListener public void addMessageListener( MessageListener listener ) { + if( listener == null ) + throw new IllegalArgumentException( "Listener cannot be null." ); listeners.add(listener); } @@ -106,6 +108,8 @@ public class MessageListenerRegistry implements MessageListener public void addMessageListener( MessageListener listener, Class... classes ) { + if( listener == null ) + throw new IllegalArgumentException( "Listener cannot be null." ); for( Class c : classes ) { getListeners(c, true).add(listener); }