gltfio: add safety checks to getAnimator.

This commit is contained in:
Philip Rideout
2020-10-28 11:12:41 -07:00
parent a6f364e0f3
commit 1159435d47
7 changed files with 37 additions and 12 deletions

View File

@@ -410,7 +410,8 @@ void SimpleViewer::updateUserInterface() {
ImGui::Unindent();
}
if (mAnimator->getAnimationCount() > 0 && ImGui::CollapsingHeader("Animation")) {
if (mAnimator && mAnimator->getAnimationCount() > 0 &&
ImGui::CollapsingHeader("Animation")) {
ImGui::Indent();
int selectedAnimation = mCurrentAnimation;
ImGui::RadioButton("Disable", &selectedAnimation, 0);