[ue4] Null check for track entry at specific index. Closes #1548.

This commit is contained in:
badlogic 2019-11-19 15:28:32 +01:00
parent 9d2353bc46
commit 8362074681
2 changed files with 8 additions and 8 deletions

View File

@ -265,7 +265,7 @@ UTrackEntry* USpineSkeletonAnimationComponent::AddEmptyAnimation (int trackIndex
UTrackEntry* USpineSkeletonAnimationComponent::GetCurrent (int trackIndex) {
CheckState();
if (state) {
if (state && state->getCurrent(trackIndex)) {
TrackEntry* entry = state->getCurrent(trackIndex);
if (entry->getRendererObject()) {
return (UTrackEntry*)entry->getRendererObject();

View File

@ -436,7 +436,7 @@ UTrackEntry* USpineWidget::AddEmptyAnimation(int trackIndex, float mixDuration,
UTrackEntry* USpineWidget::GetCurrent(int trackIndex) {
CheckState();
if (state) {
if (state && state->getCurrent(trackIndex)) {
TrackEntry* entry = state->getCurrent(trackIndex);
if (entry->getRendererObject()) {
return (UTrackEntry*)entry->getRendererObject();