diff --git a/src/org/usfirst/frc/team4737/robot/OI.java b/src/org/usfirst/frc/team4737/robot/OI.java index e29c93d..baf5544 100644 --- a/src/org/usfirst/frc/team4737/robot/OI.java +++ b/src/org/usfirst/frc/team4737/robot/OI.java @@ -60,6 +60,8 @@ public OI() { // User override to take control of the intake new Trigger() { public boolean get() { + if (Robot.getInstance() == null) + return false; return !Robot.getInstance().isAutonomous() && (operator.getAxis("LT").get() != 0 || operator.getAxis("RT").get() != 0 || operator.getAxis("RS_X").get() != 0); } @@ -68,6 +70,8 @@ public boolean get() { // User override to take control of driving new Trigger() { public boolean get() { + if (Robot.getInstance() == null) + return false; return !Robot.getInstance().isAutonomous() && (driver.getThumbstick("LS").X.get() != 0 || driver.getAxis("LT").get() != 0 || driver.getAxis("RT").get() != 0); } @@ -76,6 +80,8 @@ public boolean get() { // User override to take control of the elevator new Trigger() { public boolean get() { + if (Robot.getInstance() == null) + return false; return !Robot.getInstance().isAutonomous() && (operator.getAxis("LS_Y").get() != 0); } }.whileActive(new ControlElevator());