Skip to content

Commit

Permalink
Merge pull request #10 from Xorgon/master
Browse files Browse the repository at this point in the history
Fixed NPE when removing entries from an IndexedObjective.
  • Loading branch information
SupaHam authored Jun 17, 2021
2 parents f142b96 + 0d158d0 commit 75a5210
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ public String put(int index, String string) {
* @return the removed entry
*/
public String remove(int index) {
String old = entries[validateIndex(index)].getPrefix();
this.scoreboard.getBukkitScoreboard().getTeams().remove(entries[validateIndex(index)]);
String old = (entries[validateIndex(index)] != null) ? entries[validateIndex(index)].getPrefix() : null;
entries[validateIndex(index)].unregister();
entries[index] = null;
return old;
}
Expand Down

0 comments on commit 75a5210

Please sign in to comment.