Need help with MissingReferenceException AnimationSelection AnimationWindow

I keep getting this error when I run LoadLevel and open another scene in my game. Deselecting play on awake on certain animations seemed to solve the problem for a while but then it came back. Also, setting a default animation seemed to solve it aswell but then the problem showed up later yet again. I’ve tried to find a way to filter out all animations in my scene to go through them but without success. Any ideas?

MissingReferenceException: The object of type ‘GameObject’ has been destroyed but you are still trying to access it.
Your script should either check if it is null or you should not destroy the object.
UnityEditor.AnimationSelection.GetAnimatedObjectNames () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Animation/AnimationSelection.cs:424)
UnityEditor.AnimationSelection.OnGUISelection (UnityEditor.AnimationSelection animSel, Int32 width) (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Animation/AnimationSelection.cs:314)
UnityEditor.AnimationWindow.OnGUI () (at C:/BuildAgent/work/812c4f5049264fad/Editor/Mono/Animation/AnimationWindow.cs:2824)
System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) (at /Applications/buildAgent/work/3df08680c6f85295/mcs/class/corlib/System.Reflection/MonoMethod.cs:222)

I was seeing this issue when exiting a scene with an animations running. The problem stopped when I issued an animation.Stop() just before issuing Application.LoadLevel();
It looks like it has to do with updating the Animation Panel when moving between movies, so not directly related to your code.