From bfd8773efa6f9fc08db48551cc2b2d0c2d3abaab Mon Sep 17 00:00:00 2001 From: Brady Date: Fri, 4 Oct 2019 09:20:26 -0500 Subject: [PATCH] Make getBaritoneForPlayer null-safe --- src/api/java/baritone/api/IBaritoneProvider.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/api/java/baritone/api/IBaritoneProvider.java b/src/api/java/baritone/api/IBaritoneProvider.java index bdefb66f..c5c6cf39 100644 --- a/src/api/java/baritone/api/IBaritoneProvider.java +++ b/src/api/java/baritone/api/IBaritoneProvider.java @@ -21,6 +21,7 @@ import baritone.api.cache.IWorldScanner; import net.minecraft.client.entity.EntityPlayerSP; import java.util.List; +import java.util.Objects; /** * Provides the present {@link IBaritone} instances @@ -57,7 +58,7 @@ public interface IBaritoneProvider { */ default IBaritone getBaritoneForPlayer(EntityPlayerSP player) { for (IBaritone baritone : getAllBaritones()) { - if (player.equals(baritone.getPlayerContext().player())) { + if (Objects.equals(player, baritone.getPlayerContext().player())) { return baritone; } }