Check for null task fields.

Fixes WORLDGUARD-3372.
This commit is contained in:
wizjany 2015-02-17 16:51:02 -05:00
parent 752ccec150
commit c9d6166fcb

View File

@ -77,7 +77,8 @@ private Class<?> getTaskClass(BukkitTask task) {
for (Class<?> type : classes) {
Optional<Field> 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) {