Skip to content

Commit d1a6767

Browse files
committed
nullcheck fixes
1 parent 5862bc4 commit d1a6767

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/bwapi/CommandTemp.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ void execute(boolean isCurrentFrame) {
6969
}
7070

7171
// Existence test
72-
if (!unit.exists()) {
72+
if (unit == null || !unit.exists()) {
7373
return;
7474
}
7575

@@ -100,7 +100,7 @@ void execute(boolean isCurrentFrame) {
100100

101101
// RLF
102102
case Attack_Unit:
103-
if (target != null || !target.exists() || !unit.getType().canAttack())
103+
if (target == null || !target.exists() || !unit.getType().canAttack())
104104
return;
105105
unit.self().order.set(Order.AttackUnit, frame);
106106
unit.self().target.set(getUnitID(target), frame);

0 commit comments

Comments
 (0)