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
3.0
PSp..om 12 years ago
parent e154d0ebab
commit c6bc0bf79b
  1. 4
      engine/src/networking/com/jme3/network/base/MessageListenerRegistry.java

@ -96,6 +96,8 @@ public class MessageListenerRegistry<S> implements MessageListener<S>
public void addMessageListener( MessageListener<? super S> listener ) public void addMessageListener( MessageListener<? super S> listener )
{ {
if( listener == null )
throw new IllegalArgumentException( "Listener cannot be null." );
listeners.add(listener); listeners.add(listener);
} }
@ -106,6 +108,8 @@ public class MessageListenerRegistry<S> implements MessageListener<S>
public void addMessageListener( MessageListener<? super S> listener, Class... classes ) public void addMessageListener( MessageListener<? super S> listener, Class... classes )
{ {
if( listener == null )
throw new IllegalArgumentException( "Listener cannot be null." );
for( Class c : classes ) { for( Class c : classes ) {
getListeners(c, true).add(listener); getListeners(c, true).add(listener);
} }

Loading…
Cancel
Save