From b808eb0464aa033d514d7d22c62acaf77415cfe9 Mon Sep 17 00:00:00 2001 From: Sunny Shao Date: Fri, 8 Nov 2019 10:53:53 +0800 Subject: [PATCH] Fix the NPE in the AnimationController Add the null checking in onBindViewHolder Fixes: 144099781 Test: compilation Change-Id: Iafb8f758d7d71ce9fa67f4ad94d5a8a417ad674a --- src/com/android/settings/widget/VideoPreference.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/com/android/settings/widget/VideoPreference.java b/src/com/android/settings/widget/VideoPreference.java index 006c13ac8f6..949ba9b8f1b 100644 --- a/src/com/android/settings/widget/VideoPreference.java +++ b/src/com/android/settings/widget/VideoPreference.java @@ -123,7 +123,9 @@ public class VideoPreference extends Preference { layout.setLayoutParams(new LinearLayout.LayoutParams( LinearLayout.LayoutParams.MATCH_PARENT, mHeight)); } - mAnimationController.attachView(mVideo, mPreviewImage, mPlayButton); + if (mAnimationController != null) { + mAnimationController.attachView(mVideo, mPreviewImage, mPlayButton); + } } @Override