Fix issue #219 - make the scheduler work

This commit is contained in:
md_5 2013-03-21 13:35:35 +11:00
parent 86b864ce21
commit a564d4c7f1

View File

@ -68,7 +68,10 @@ public class BungeeScheduler implements TaskScheduler
private BungeeTask prepare(Plugin owner, Runnable task)
{
int id = taskCounter.getAndIncrement();
return tasks.put( id, new BungeeTask( taskCounter.getAndIncrement(), owner, task ) );
Preconditions.checkNotNull( owner, "owner" );
Preconditions.checkNotNull( task, "task" );
BungeeTask prepared = new BungeeTask( taskCounter.getAndIncrement(), owner, task );
tasks.put( prepared.getId(), prepared );
return prepared;
}
}