add tests for emitter

This commit is contained in:
Naoyuki Kanezawa
2013-04-30 04:27:23 +09:00
parent 7124af51af
commit 8b7b2125fc
2 changed files with 230 additions and 1 deletions

View File

@@ -80,7 +80,8 @@ public class Emitter {
public List<Listener> listeners(String event) {
ConcurrentLinkedQueue<Listener> callbacks = this.callbacks.get(event);
return new ArrayList<Listener>(callbacks);
return callbacks != null ?
new ArrayList<Listener>(callbacks) : new ArrayList<Listener>();
}
public boolean hasListeners(String event) {