diff --git a/Source/SenseGloveEditor/Private/SGEditor/SGAssetUtils.cpp b/Source/SenseGloveEditor/Private/SGEditor/SGAssetUtils.cpp index 11a3aa3e..31826298 100644 --- a/Source/SenseGloveEditor/Private/SGEditor/SGAssetUtils.cpp +++ b/Source/SenseGloveEditor/Private/SGEditor/SGAssetUtils.cpp @@ -319,12 +319,12 @@ FTransform FSGAssetUtils::FImpl::GetHandBoneRefTransform( } const FReferenceSkeleton& ReferenceSkeleton{SkeletalMesh->GetRefSkeleton()}; - const int32 BoneIndex = ReferenceSkeleton.FindBoneIndex(BoneName); - if (BoneIndex == INDEX_NONE) + const int32 BoneIndex = ReferenceSkeleton.FindBoneIndex(BoneName); + if (!ensureAlwaysMsgf(BoneIndex != INDEX_NONE, + TEXT("Could not find a bone index for the '%s' joint!"), *BoneName.ToString())) { - SGLOG_WARNING(FString::Printf(TEXT("Could not find a bone index for the '%s' joint!"), - *BoneName.ToString())); + return FTransform::Identity; } const TArray Transforms{ReferenceSkeleton.GetRefBonePose()};