From 2a50e8989be6be5bb7462070aca9a826c9233d36 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simon=20B=C3=B8g=20J=C3=B8rgensen?= Date: Wed, 6 Nov 2024 11:45:20 +0100 Subject: [PATCH] Added a check to see if activeVehicle is null as that could cause a null exception --- src/Joystick/Joystick.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Joystick/Joystick.cc b/src/Joystick/Joystick.cc index f210a80a785..c44274119e5 100644 --- a/src/Joystick/Joystick.cc +++ b/src/Joystick/Joystick.cc @@ -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);