Skip to content

Commit accbdf5

Browse files
flTobiNicholasBatesNZ
authored andcommitted
Change String comparison to a null-safe variant
1 parent a3e3b8c commit accbdf5

File tree

1 file changed

+2
-1
lines changed
  • engine/src/main/java/org/destinationsol/game/ship

1 file changed

+2
-1
lines changed

engine/src/main/java/org/destinationsol/game/ship/SolShip.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@
5050
import org.destinationsol.game.ship.hulls.HullConfig;
5151

5252
import java.util.List;
53+
import java.util.Objects;
5354

5455
public class SolShip implements SolObject {
5556
public static final float BASE_DUR_MOD = .3f;
@@ -190,7 +191,7 @@ private boolean tryCollectLoot(SolObject obj, SolGame game) {
190191
boolean canAdd = c.canAdd(i);
191192
if (canAdd) {
192193
c.add(i);
193-
if (c == myItemContainer && myPilot.getMapHint().equals("Merc")) {
194+
if (c == myItemContainer && Objects.equals(myPilot.getMapHint(), "Merc")) {
194195
//insert equip code here, if it's something we want to do
195196
}
196197
}

0 commit comments

Comments
 (0)