Fix for crash on avatars with missing "Hips" joint

This commit is contained in:
Anthony Thibault 2016-07-22 16:00:40 -07:00
parent 5202038210
commit a43e9a5710

View file

@ -861,7 +861,11 @@ void AnimInverseKinematics::setSkeletonInternal(AnimSkeleton::ConstPointer skele
_hipsIndex = _skeleton->nameToJointIndex("Hips");
// also cache the _hipsParentIndex for later
_hipsParentIndex = _skeleton->getParentIndex(_hipsIndex);
if (_hipsIndex >= 0) {
_hipsParentIndex = _skeleton->getParentIndex(_hipsIndex);
} else {
_hipsParentIndex = -1;
}
} else {
clearConstraints();
_headIndex = -1;