DeepBlueRobotics / lib199

Code that we reuse in different projects/years.
Other
2 stars 0 forks source link

Error Message for having more than one CANSparkMax use the same port for Simulation #66

Open ProfessorAtomicManiac opened 8 months ago

ProfessorAtomicManiac commented 8 months ago

People were running "Simulate Robot Code" and they had more than one CANSparkMax use the same port. They got this error:

Error at org.carlmontrobotics.lib199.sim.MockSparkMax.<init>(MockSparkMax.java:38): Unhandled exception: java.lang.NullPointerException: Cannot invoke "edu.wpi.first.hal.SimDevice.createDouble(String, edu.wpi.first.hal.SimDevice$Direction, double)" because "this.motor" is null
        at org.carlmontrobotics.lib199.sim.MockSparkMax.<init>(MockSparkMax.java:38)

It would be nice if instead the error message said "More than one CANSparkMax has that port id" or something like that.