Merge "Fix NPE crash in TextToSpeechSettings" am: 6672e37864 am: 451ced2f5a am: 1b69e6b87c am: f0c250900c am: fc899d5e64

Original change: https://android-review.googlesource.com/c/platform/packages/apps/Settings/+/2208995

Change-Id: I4129c2fce49101a1d569b2cfb91b3684a31fcc46
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Treehugger Robot
2022-09-08 03:17:05 +00:00
committed by Automerger Merge Worker

View File

@@ -228,7 +228,9 @@ public class TextToSpeechSettings extends SettingsPreferenceFragment
// them to resize, which results in the recyclerview smoothly animating them at inopportune
// times. Disable the animation so widgets snap to their positions rather than sliding
// around while the user is interacting with it.
getListView().getItemAnimator().setMoveDuration(0);
if (getListView().getItemAnimator() != null) {
getListView().getItemAnimator().setMoveDuration(0);
}
if (mTts == null || mCurrentDefaultLocale == null) {
return;