mirror of
https://github.com/GeyserMC/Geyser.git
synced 2025-02-16 18:31:57 +01:00
Fixed an issue where there would be a null score in SetScorePacket
This commit is contained in:
parent
6e56666be2
commit
58ff00db96
1 changed files with 6 additions and 1 deletions
|
@ -258,7 +258,12 @@ public final class Scoreboard {
|
||||||
|
|
||||||
for (Score score : objective.getScores().values()) {
|
for (Score score : objective.getScores().values()) {
|
||||||
if (score.getUpdateType() == REMOVE) {
|
if (score.getUpdateType() == REMOVE) {
|
||||||
removeScores.add(score.getCachedInfo());
|
ScoreInfo cachedInfo = score.getCachedInfo();
|
||||||
|
// cachedInfo can be null here when ScoreboardUpdater is being used and a score is added and
|
||||||
|
// removed before a single update cycle is performed
|
||||||
|
if (cachedInfo != null) {
|
||||||
|
removeScores.add(cachedInfo);
|
||||||
|
}
|
||||||
// score is pending to be removed, so we can remove it from the objective
|
// score is pending to be removed, so we can remove it from the objective
|
||||||
objective.removeScore0(score.getName());
|
objective.removeScore0(score.getName());
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Add table
Reference in a new issue