From 8a17bfc000002e471900b4b8c375bcf61c4448f3 Mon Sep 17 00:00:00 2001 From: Phoenix616 Date: Sat, 27 Apr 2019 01:24:24 +0100 Subject: [PATCH] Check correct exception for logging it --- .../src/main/java/de/themoep/randomteleport/RandomTeleport.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java index 58fa932..7e9e0c7 100644 --- a/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java +++ b/randomteleport-plugin/src/main/java/de/themoep/randomteleport/RandomTeleport.java @@ -348,7 +348,7 @@ public class RandomTeleport extends JavaPlugin implements RandomTeleportAPI { return true; }).exceptionally(ex -> { 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); } searcher.getTargets().forEach(e -> {