mirror of
https://github.com/TotalFreedomMC/TFGuilds.git
synced 2025-01-03 13:38:19 +00:00
Added check to check if user is null or not Added check to make sure the stripped strings are not null (tfm tag & guild tag)
This commit is contained in:
parent
73cfc7e46b
commit
097e5feab1
1 changed files with 10 additions and 4 deletions
|
@ -43,13 +43,19 @@ public class JoinListener implements Listener
|
||||||
|
|
||||||
int maxLength = ConfigEntry.GLOBAL_TAG_MAX_LENGTH.getInteger();
|
int maxLength = ConfigEntry.GLOBAL_TAG_MAX_LENGTH.getInteger();
|
||||||
String tfmTag = TFGuilds.getPlugin().getTfmBridge().getTag(player);
|
String tfmTag = TFGuilds.getPlugin().getTfmBridge().getTag(player);
|
||||||
if (user.displayTag() && tfmTag != null && guild.getTag() != null && maxLength > 0)
|
if (user != null && user.displayTag() && tfmTag != null && guild.getTag() != null && maxLength > 0)
|
||||||
{
|
{
|
||||||
int length = GUtil.removeColorCodes(tfmTag).length() + GUtil.removeColorCodes(guild.getTag()).length();
|
String tfmTagStripped = GUtil.removeColorCodes(tfmTag);
|
||||||
if (length > maxLength)
|
String guildTagStripped = GUtil.removeColorCodes(guild.getTag());
|
||||||
|
if (tfmTagStripped != null && guildTagStripped != null)
|
||||||
{
|
{
|
||||||
TFGuilds.getPlugin().getTfmBridge().clearTag(player);
|
int length = GUtil.removeColorCodes(tfmTag).length() + GUtil.removeColorCodes(guild.getTag()).length();
|
||||||
|
if (length > maxLength)
|
||||||
|
{
|
||||||
|
TFGuilds.getPlugin().getTfmBridge().clearTag(player);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue