Skip to content

Commit

Permalink
Added a check to see if activeVehicle is null as that could cause a n…
Browse files Browse the repository at this point in the history
…ull exception
  • Loading branch information
Simon Bøg Jørgensen committed Nov 6, 2024
1 parent a022c9c commit 2a50e89
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Joystick/Joystick.cc
Original file line number Diff line number Diff line change
Expand Up @@ -569,7 +569,7 @@ void Joystick::_handleAxis()
_rgAxisValues[axisIndex] = newAxisValue;
emit rawAxisValueChanged(axisIndex, newAxisValue);
}
if (_activeVehicle->joystickEnabled() && !_calibrationMode && _calibrated) {
if (_activeVehicle && _activeVehicle->joystickEnabled() && !_calibrationMode && _calibrated) {
int axis = _rgFunctionAxis[rollFunction];
float roll = _adjustRange(_rgAxisValues[axis], _rgCalibration[axis], _deadband);

Expand Down

0 comments on commit 2a50e89

Please sign in to comment.