mirror of
https://github.com/TotalFreedomMC/TF-EssentialsX.git
synced 2025-08-07 13:03:00 +00:00
Add null check in ignore command (#3226)
This would only become a problem if a server owner decided to delete a bunch of their userdata. Nonetheless, it doesn't hurt to have the check.
I promise this is the last pull request regarding this 😄
This commit is contained in:
parent
dd5fe117b5
commit
fd136384a1
1 changed files with 4 additions and 1 deletions
|
@ -20,7 +20,10 @@ public class Commandignore extends EssentialsCommand {
|
||||||
if (args.length < 1) {
|
if (args.length < 1) {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
for (UUID uuid : user._getIgnoredPlayers()) {
|
for (UUID uuid : user._getIgnoredPlayers()) {
|
||||||
sb.append(ess.getUser(uuid).getName()).append(" ");
|
User curUser = ess.getUser(uuid);
|
||||||
|
if (curUser != null && curUser.getName() != null && !curUser.getName().trim().equals("")) {
|
||||||
|
sb.append(curUser.getName()).append(" ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
String ignoredList = sb.toString().trim();
|
String ignoredList = sb.toString().trim();
|
||||||
user.sendMessage(ignoredList.length() > 0 ? tl("ignoredList", ignoredList) : tl("noIgnored"));
|
user.sendMessage(ignoredList.length() > 0 ? tl("ignoredList", ignoredList) : tl("noIgnored"));
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue