Make LinearWaypointProvider more null safe

This commit is contained in:
fullwall 2019-12-21 20:25:38 +09:00
parent 3186f6de5e
commit 5972e3dffc

View File

@ -103,7 +103,7 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
@Override
public boolean isPaused() {
return currentGoal.isPaused();
return currentGoal == null ? false : currentGoal.isPaused();
}
@Override
@ -118,7 +118,10 @@ public class LinearWaypointProvider implements EnumerableWaypointProvider {
@Override
public void onRemove() {
if (currentGoal != null) {
npc.getDefaultGoalController().removeGoal(currentGoal);
currentGoal = null;
}
}
@Override