From 3d71b8e8e88dbc018e9187d34d2d12dee2671f73 Mon Sep 17 00:00:00 2001 From: Brian Semrau Date: Fri, 23 Mar 2018 12:03:35 -0400 Subject: [PATCH] Fixed nullpointer issue --- src/org/usfirst/frc/team4737/robot/OI.java | 6 ++++++ 1 file changed, 6 insertions(+) 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());