Skip to content

Commit 4f202ff

Browse files
committed
FIX: another missing if() protecting access to uninitialized js data
1 parent f1c01be commit 4f202ff

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/simulator/src/VehicleDynamics/VehicleAckermann_ControllerTwistFrontSteerPID.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -170,7 +170,7 @@ void DynamicsAckermann::ControllerTwistFrontSteerPID::teleop_interface(
170170

171171
out.append_gui_lines += "[Controller=" + std::string(class_name()) + "]";
172172

173-
if (in.js)
173+
if (in.js && in.js->axes.size() >= 2)
174174
{
175175
const auto& js = in.js.value();
176176
const float js_x = js.axes[0];

0 commit comments

Comments
 (0)