fix: some emergency issue i don't know what is causing
This commit is contained in:
@@ -1 +1 @@
|
||||
1300
|
||||
1301
|
||||
@@ -39,6 +39,7 @@ public class ListCommand extends Command {
|
||||
final List<Component> playersComponent = new ArrayList<>();
|
||||
|
||||
for (PlayerEntry entry : list) {
|
||||
if (entry == null) continue;
|
||||
playersComponent.add(
|
||||
Component.translatable(
|
||||
"%s › %s",
|
||||
|
||||
@@ -91,7 +91,7 @@ public class PlayersPlugin extends Bot.Listener {
|
||||
|
||||
public final PlayerEntry getEntry (UUID uuid) {
|
||||
for (PlayerEntry candidate : list) {
|
||||
if (candidate.profile.getId().equals(uuid)) {
|
||||
if (candidate != null && candidate.profile.getId().equals(uuid)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
@@ -101,7 +101,7 @@ public class PlayersPlugin extends Bot.Listener {
|
||||
|
||||
public final PlayerEntry getEntry (String username) {
|
||||
for (PlayerEntry candidate : list) {
|
||||
if (getName(candidate).equals(username) || candidate.usernames.contains(username)) {
|
||||
if (candidate != null && (getName(candidate).equals(username) || candidate.usernames.contains(username))) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
@@ -111,7 +111,7 @@ public class PlayersPlugin extends Bot.Listener {
|
||||
|
||||
public final PlayerEntry getEntry (Component displayName) {
|
||||
for (PlayerEntry candidate : list) {
|
||||
if (candidate.displayName != null && candidate.displayName.equals(displayName)) {
|
||||
if (candidate != null && candidate.displayName != null && candidate.displayName.equals(displayName)) {
|
||||
return candidate;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user