Skip to content

Commit

Permalink
[#482] Refactor getPlayer with wrong computeIfAbsent usage to fix N…
Browse files Browse the repository at this point in the history
…PE when using an automata turtle for the first time
  • Loading branch information
SirEndii committed Jul 7, 2023
1 parent 972be60 commit eebefcf
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ private FakePlayerProviderTurtle() {
}

public static APFakePlayer getPlayer(ITurtleAccess turtle, GameProfile profile) {
return registeredPlayers.computeIfAbsent(turtle, iTurtleAccess -> registeredPlayers.put(turtle, new APFakePlayer((ServerLevel) turtle.getLevel(), null, profile)));
return registeredPlayers.computeIfAbsent(turtle, iTurtleAccess -> new APFakePlayer((ServerLevel) turtle.getLevel(), null, profile));
}

public static void load(APFakePlayer player, ITurtleAccess turtle) {
Expand Down

0 comments on commit eebefcf

Please sign in to comment.