mirror of
https://github.com/wpilibsuite/allwpilib
synced 2026-06-22 01:11:42 +00:00
DriverStation: fix error checking for GetXXXAxis and GetXXXPov (#1469)
Fixes #1436
This commit is contained in:
committed by
Peter Johnson
parent
dcbf02a1ec
commit
b64dfacff3
@@ -420,7 +420,7 @@ public class DriverStation {
|
||||
if (stick < 0 || stick >= kJoystickPorts) {
|
||||
throw new IllegalArgumentException("Joystick index is out of range, should be 0-5");
|
||||
}
|
||||
if (axis >= HAL.kMaxJoystickAxes) {
|
||||
if (axis < 0 || axis >= HAL.kMaxJoystickAxes) {
|
||||
throw new IllegalArgumentException("Joystick axis is out of range");
|
||||
}
|
||||
|
||||
@@ -451,7 +451,7 @@ public class DriverStation {
|
||||
if (stick < 0 || stick >= kJoystickPorts) {
|
||||
throw new IllegalArgumentException("Joystick index is out of range, should be 0-5");
|
||||
}
|
||||
if (pov >= HAL.kMaxJoystickPOVs) {
|
||||
if (pov < 0 || pov >= HAL.kMaxJoystickPOVs) {
|
||||
throw new IllegalArgumentException("Joystick POV is out of range");
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user