mirror of
https://github.com/CitizensDev/Citizens2.git
synced 2025-02-18 21:32:48 +01:00
Fix more NPEs
This commit is contained in:
parent
94340f15ff
commit
d5162464bd
@ -76,7 +76,7 @@ public class NPCScoreboard extends Trait {
|
||||
objectives.add(objective);
|
||||
}
|
||||
Team playerTeam = objectives.iterator().next().getScoreboard().getPlayerTeam((Player) npc.getEntity());
|
||||
if (team == null) {
|
||||
if (team == null && playerTeam != null) {
|
||||
team = playerTeam.getName();
|
||||
}
|
||||
if (scoreboard == null) {
|
||||
@ -100,7 +100,10 @@ public class NPCScoreboard extends Trait {
|
||||
}
|
||||
}
|
||||
if (npc.getEntity() instanceof Player && team == null) {
|
||||
team = objectives.iterator().next().getScoreboard().getPlayerTeam((Player) npc.getEntity()).getName();
|
||||
Team playerTeam = objectives.iterator().next().getScoreboard().getPlayerTeam((Player) npc.getEntity());
|
||||
if (playerTeam != null) {
|
||||
team = playerTeam.getName();
|
||||
}
|
||||
}
|
||||
if (team != null) {
|
||||
root.setString("team", team);
|
||||
|
Loading…
Reference in New Issue
Block a user