Repeated Error

Everytime I attempt to run a command based robot code I get this error. It only happens as soon as I add subsystems and is a command based.

Unhandled exception instantiating robot
org.usfirst.frc2509.Robot2015d.v3.Robot java.lang.NullPointerException
at [org.usfirst.frc2509.Robot2015d.v3.Robot.<init>(,
sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method),

If anyone can help me go in the right direction to fix this error that would be great. Here is the link to the code.

Quick and Dirty Answer:

You refer to Robot.oi.lStick on line 46 of (See the top of the stack trace). At that point of code execution Robot.oi has been declared (see line 35), but not assigned a value yet. That doesn’t happen until late inside the robotInit() function (function starts line 52, assigned value at 67).

If you just declare the variable, and remove the assignment at 46 (and 47) and assign the value in robotInit() after line 67, you should get past that problem.

(Sorry I didn’t check for any others you might run into after this.)