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 authored and HTRamsey committed Nov 7, 2024
1 parent 1e4d79d commit 0a59f84
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 0a59f84

Please sign in to comment.