Fix a possible crash in EventBus

This commit is contained in:
luacs1998 2015-09-27 12:47:37 +08:00
parent 1e7fbb7018
commit 05f6ede2ea
1 changed files with 2 additions and 0 deletions

View File

@ -121,6 +121,8 @@ public class EventBus implements IEventExceptionHandler
public void unregister(Object object)
{
ArrayList<IEventListener> list = listeners.remove(object);
if(list == null)
return;
for (IEventListener listener : list)
{
ListenerList.unregisterAll(busID, listener);