Check correct exception for logging it

This commit is contained in:
Phoenix616 2019-04-27 01:24:24 +01:00
parent 6b98efb1e4
commit 8a17bfc000

View File

@ -348,7 +348,7 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI {
return true; return true;
}).exceptionally(ex -> { }).exceptionally(ex -> {
sendMessage(sender, "error.location"); sendMessage(sender, "error.location");
if (!(ex instanceof NotFoundException)) { if (!(ex.getCause() instanceof NotFoundException)) {
getLogger().log(Level.SEVERE, "Error while trying to find a location!", ex); getLogger().log(Level.SEVERE, "Error while trying to find a location!", ex);
} }
searcher.getTargets().forEach(e -> { searcher.getTargets().forEach(e -> {