Explorar o código

Added a null check to the AnimationController's animations array.

Gareth Fouche %!s(int64=9) %!d(string=hai) anos
pai
achega
3edf4aeaab
Modificáronse 1 ficheiros con 7 adicións e 0 borrados
  1. 7 0
      Source/Atomic/Graphics/AnimationController.cpp

+ 7 - 0
Source/Atomic/Graphics/AnimationController.cpp

@@ -194,6 +194,10 @@ bool AnimationController::Play(const String& name, unsigned char layer, bool loo
     {
         for (unsigned i = 0; i < animationResources_.Size(); i++)
         {
+            if (animationResources_[i] == NULL)
+                continue;
+
+        
             if (name == animationResources_[i]->GetAnimationName())
             {
                 newAnimation = animationResources_[i];
@@ -930,6 +934,9 @@ void AnimationController::FindAnimation(const String& name, unsigned& index, Ani
     {
         for (unsigned i = 0; i < animationResources_.Size(); i++)
         {
+            if (animationResources_[i] == NULL)
+                continue;
+
             if (name == animationResources_[i]->GetAnimationName())
             {
                 nameHash = animationResources_[i]->GetName();