From fdf6d24e03a8c1322eb5bc864e858c1ccdf33c84 Mon Sep 17 00:00:00 2001 From: Ian Chen Date: Wed, 16 Oct 2024 10:28:25 -0700 Subject: [PATCH] Fix crash when multicopter motor system is attached to an empty model (#2653) Signed-off-by: Ian Chen --- src/systems/multicopter_motor_model/MulticopterMotorModel.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/systems/multicopter_motor_model/MulticopterMotorModel.cc b/src/systems/multicopter_motor_model/MulticopterMotorModel.cc index 2bfe779776..a3cda4b082 100644 --- a/src/systems/multicopter_motor_model/MulticopterMotorModel.cc +++ b/src/systems/multicopter_motor_model/MulticopterMotorModel.cc @@ -411,7 +411,8 @@ void MulticopterMotorModel::PreUpdate(const UpdateInfo &_info, const auto parentLinkName = _ecm.Component( this->dataPtr->jointEntity); - this->dataPtr->parentLinkName = parentLinkName->Data(); + if (parentLinkName) + this->dataPtr->parentLinkName = parentLinkName->Data(); } if (this->dataPtr->linkEntity == kNullEntity)