Skip to content

Commit

Permalink
Fix accessing empty JointPosition component in lift drag plugin (#1366)
Browse files Browse the repository at this point in the history
Check for empty JointControl component before accessing it

Signed-off-by: Ian Chen <[email protected]>
  • Loading branch information
iche033 authored Feb 25, 2022
1 parent d3a5015 commit 0ae1324
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/systems/lift_drag/LiftDrag.cc
Original file line number Diff line number Diff line change
Expand Up @@ -382,7 +382,7 @@ void LiftDragPrivate::Update(EntityComponentManager &_ecm)
cl = this->cla * alpha * cosSweepAngle;

// modify cl per control joint value
if (controlJointPosition)
if (controlJointPosition && !controlJointPosition->Data().empty())
{
cl = cl + this->controlJointRadToCL * controlJointPosition->Data()[0];
/// \todo(anyone): also change cm and cd
Expand Down

0 comments on commit 0ae1324

Please sign in to comment.