mirror of
https://github.com/EngineHub/WorldGuard.git
synced 2024-11-09 04:20:26 +01:00
Check for null task fields.
Fixes WORLDGUARD-3372.
This commit is contained in:
parent
752ccec150
commit
c9d6166fcb
@ -77,7 +77,8 @@ private Class<?> getTaskClass(BukkitTask task) {
|
|||||||
for (Class<?> type : classes) {
|
for (Class<?> type : classes) {
|
||||||
Optional<Field> field = taskFieldCache.getUnchecked(type);
|
Optional<Field> field = taskFieldCache.getUnchecked(type);
|
||||||
if (field.isPresent()) {
|
if (field.isPresent()) {
|
||||||
return field.get().get(task).getClass();
|
Object res = field.get().get(task);
|
||||||
|
return res == null ? null : res.getClass();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (IllegalAccessException ignored) {
|
} catch (IllegalAccessException ignored) {
|
||||||
|
Loading…
Reference in New Issue
Block a user