From c9d6166fcbb15ebf49f2098547779e18ef9a1036 Mon Sep 17 00:00:00 2001 From: wizjany Date: Tue, 17 Feb 2015 16:51:02 -0500 Subject: [PATCH] Check for null task fields. Fixes WORLDGUARD-3372. --- .../sk89q/worldguard/bukkit/util/report/SchedulerReport.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/main/java/com/sk89q/worldguard/bukkit/util/report/SchedulerReport.java b/src/main/java/com/sk89q/worldguard/bukkit/util/report/SchedulerReport.java index 9e866f15..21d76ee1 100644 --- a/src/main/java/com/sk89q/worldguard/bukkit/util/report/SchedulerReport.java +++ b/src/main/java/com/sk89q/worldguard/bukkit/util/report/SchedulerReport.java @@ -77,7 +77,8 @@ private Class getTaskClass(BukkitTask task) { for (Class type : classes) { Optional field = taskFieldCache.getUnchecked(type); if (field.isPresent()) { - return field.get().get(task).getClass(); + Object res = field.get().get(task); + return res == null ? null : res.getClass(); } } } catch (IllegalAccessException ignored) {