diff --git a/engine/src/main/battlecode/world/RobotControllerImpl.java b/engine/src/main/battlecode/world/RobotControllerImpl.java index 07d96612..0633c0ce 100644 --- a/engine/src/main/battlecode/world/RobotControllerImpl.java +++ b/engine/src/main/battlecode/world/RobotControllerImpl.java @@ -610,6 +610,9 @@ private void assertCanUpgradeTower(MapLocation loc) throws GameActionException{ assertCanActLocation(loc, GameConstants.BUILD_TOWER_RADIUS_SQUARED); InternalRobot robot = this.gameWorld.getRobot(loc); + if (robot == null){ + throw new GameActionException(CANT_DO_THAT, "There is no robot at the location"); + } if (!this.robot.getType().isTowerType()){ throw new GameActionException(CANT_DO_THAT, "No tower at the location"); }