Merge pull request #332 from cindyker/versions/spigot1.8-5.x

Fix broken blacklist (NullPointerException).
This commit is contained in:
sk89q 2014-12-05 22:54:54 -08:00
commit 83b1dabcdd

View File

@ -20,6 +20,7 @@
package com.sk89q.worldguard.blacklist; package com.sk89q.worldguard.blacklist;
import com.google.common.cache.Cache; import com.google.common.cache.Cache;
import com.google.common.cache.LoadingCache;
import com.sk89q.worldguard.LocalPlayer; import com.sk89q.worldguard.LocalPlayer;
import com.sk89q.worldguard.blacklist.action.Action; import com.sk89q.worldguard.blacklist.action.Action;
import com.sk89q.worldguard.blacklist.action.ActionResult; import com.sk89q.worldguard.blacklist.action.ActionResult;
@ -181,7 +182,7 @@ public boolean check(boolean useAsWhitelist, BlacklistEvent event, boolean force
Cache<String, TrackedEvent> repeatingEventCache = blacklist.getRepeatingEventCache(); Cache<String, TrackedEvent> repeatingEventCache = blacklist.getRepeatingEventCache();
// Check to see whether this event is being repeated // Check to see whether this event is being repeated
TrackedEvent tracked = repeatingEventCache.getIfPresent(eventCacheKey); TrackedEvent tracked = ((LoadingCache<String, TrackedEvent>)repeatingEventCache).getUnchecked(eventCacheKey);
if (tracked.matches(event)) { if (tracked.matches(event)) {
repeating = true; repeating = true;
} else { } else {