Idk how it can be null, but well ...

This commit is contained in:
Xephi 2015-12-04 17:17:35 +01:00
parent a1f963adf8
commit 0d1cf8c7e2
3 changed files with 12 additions and 2 deletions

View File

@ -117,6 +117,8 @@ public class LimboCache {
* @param name String * @param name String
*/ */
public void deleteLimboPlayer(String name) { public void deleteLimboPlayer(String name) {
if (name == null)
return;
cache.remove(name); cache.remove(name);
} }
@ -128,6 +130,8 @@ public class LimboCache {
* @return LimboPlayer * @return LimboPlayer
*/ */
public LimboPlayer getLimboPlayer(String name) { public LimboPlayer getLimboPlayer(String name) {
if (name == null)
return null;
return cache.get(name); return cache.get(name);
} }
@ -139,6 +143,8 @@ public class LimboCache {
* @return boolean * @return boolean
*/ */
public boolean hasLimboPlayer(String name) { public boolean hasLimboPlayer(String name) {
if (name == null)
return false;
return cache.containsKey(name); return cache.containsKey(name);
} }

View File

@ -253,8 +253,11 @@ public class AsynchronousJoin {
? m.retrieve(MessageKey.REGISTER_EMAIL_MESSAGE) ? m.retrieve(MessageKey.REGISTER_EMAIL_MESSAGE)
: m.retrieve(MessageKey.REGISTER_MESSAGE); : m.retrieve(MessageKey.REGISTER_MESSAGE);
} }
BukkitTask msgTask = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval)); if (LimboCache.getInstance().getLimboPlayer(name) != null)
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgTask); {
BukkitTask msgTask = sched.runTaskAsynchronously(plugin, new MessageTask(plugin, name, msg, msgInterval));
LimboCache.getInstance().getLimboPlayer(name).setMessageTaskId(msgTask);
}
} }
private boolean needFirstSpawn() { private boolean needFirstSpawn() {

View File

@ -393,6 +393,7 @@ Protection:
- 'US' - 'US'
- 'GB' - 'GB'
# Countries blacklisted automatically ( without any needed to enable protection ) # Countries blacklisted automatically ( without any needed to enable protection )
# PLEASE USE QUOTES!
countriesBlacklist: countriesBlacklist:
- 'A1' - 'A1'
# Do we need to enable automatic antibot system? # Do we need to enable automatic antibot system?