diff --git a/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java b/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java index 1dc1cc66e6..fd0dabcf46 100644 --- a/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java +++ b/proxy/src/main/java/net/md_5/bungee/scheduler/BungeeScheduler.java @@ -62,9 +62,12 @@ public void cancel(ScheduledTask task) public int cancel(Plugin plugin) { Set toRemove = new HashSet<>(); - for ( ScheduledTask task : tasksByPlugin.get( plugin ) ) + synchronized ( lock ) { - toRemove.add( task ); + for ( ScheduledTask task : tasksByPlugin.get( plugin ) ) + { + toRemove.add( task ); + } } for ( ScheduledTask task : toRemove ) {