Adds defensive code to avoid NPE with hiding clipboard

This commit is contained in:
tastybento 2019-01-13 15:57:45 -08:00
parent fa8c0ec0c8
commit 5ed86ea271

View File

@ -9,6 +9,7 @@ import java.util.UUID;
import org.bukkit.Bukkit;
import org.bukkit.Color;
import org.bukkit.Particle;
import world.bentobox.bentobox.api.commands.CompositeCommand;
import world.bentobox.bentobox.api.commands.ConfirmableCommand;
import world.bentobox.bentobox.api.user.User;
@ -107,8 +108,10 @@ public class AdminSchemCommand extends ConfirmableCommand {
}
void hideClipboard(User user) {
Bukkit.getScheduler().cancelTask(displayClipboards.get(user));
displayClipboards.remove(user);
if (displayClipboards.containsKey(user)) {
Bukkit.getScheduler().cancelTask(displayClipboards.get(user));
displayClipboards.remove(user);
}
}
File getSchemsFolder() {