Check if getTeleportRequest() is null in /tpdeny. Fixes #1229.

This commit is contained in:
Ali Moghnieh 2017-05-04 13:41:27 +01:00
parent 747420b4c8
commit 4bfabaa1d3
No known key found for this signature in database
GPG key ID: F09D3A1BAF2E6D70

View file

@ -13,6 +13,9 @@ public class Commandtpdeny extends EssentialsCommand {
@Override
public void run(final Server server, final User user, final String commandLabel, final String[] args) throws Exception {
if (user.getTeleportRequest() == null) {
throw new Exception(tl("noPendingRequest"));
}
final User player = ess.getUser(user.getTeleportRequest());
if (player == null) {
throw new Exception(tl("noPendingRequest"));