Skip to content

Commit

Permalink
Fixed nullpointer issue
Browse files Browse the repository at this point in the history
  • Loading branch information
briansemrau committed Mar 23, 2018
1 parent 1afc563 commit 3d71b8e
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/org/usfirst/frc/team4737/robot/OI.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand All @@ -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);
}
Expand All @@ -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());
Expand Down

0 comments on commit 3d71b8e

Please sign in to comment.