From 45d35a68e3b84ef5aad3272324034d37d683f0ed Mon Sep 17 00:00:00 2001 From: Marcel Kronfeld Date: Wed, 17 Sep 2008 09:58:26 +0000 Subject: [PATCH] Minor cosmetics. (mk rev 209) --- src/eva2/server/go/populations/Population.java | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/eva2/server/go/populations/Population.java b/src/eva2/server/go/populations/Population.java index 1fd848c0..9ecb6957 100644 --- a/src/eva2/server/go/populations/Population.java +++ b/src/eva2/server/go/populations/Population.java @@ -232,7 +232,7 @@ public class Population extends ArrayList implements PopulationInterface, Clonea if (listeners != null) { for (Iterator iterator = listeners.iterator(); iterator.hasNext();) { InterfacePopulationChangedEventListener listener = (InterfacePopulationChangedEventListener) iterator.next(); - listener.registerPopulationStateChanged(this, name); + if (listener!=null) listener.registerPopulationStateChanged(this, name); } } } @@ -300,9 +300,11 @@ public class Population extends ArrayList implements PopulationInterface, Clonea * @param ea */ public void addPopulationChangedEventListener(InterfacePopulationChangedEventListener ea) { - if (listeners == null) listeners = new ArrayList(3); - if (!listeners.contains(ea)) { - listeners.add(ea); + if (ea != null) { + if (listeners == null) listeners = new ArrayList(3); + if (!listeners.contains(ea)) { + listeners.add(ea); + } } }