Fix NPE in overridePlayingAppAnimations

It's not guaranteed that findMainWindow() is non-null, which can happen
if the window was just added, so we should not crash in that case.

Change-Id: I1f04876ef48bfc7636320124b7f60d6dfa0b24a2
Fixes: 31767124
This commit is contained in:
Jorim Jaggi
2016-09-28 13:30:27 +02:00
parent 4e236046ae
commit 6e5f3d2e9f

View File

@@ -846,6 +846,9 @@ class AppWindowToken extends WindowToken {
void overridePlayingAppAnimations(Animation a) {
if (mAppAnimator.isAnimating()) {
final WindowState win = findMainWindow();
if (win == null) {
return;
}
final int width = win.mContainingFrame.width();
final int height = win.mContainingFrame.height();
mAppAnimator.setAnimation(a, width, height, false, STACK_CLIP_NONE);