Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 70b8bd92 authored by Tsung-Mao Fang's avatar Tsung-Mao Fang
Browse files

Fix NPE crash in TextToSpeechSettings

Recyclerview's getItemAnimator() is nullable so we need a null check.

Bug: 254330134
Test: Manual
Change-Id: Iba5b0d68740c430fd1143d38ccf344afef486784
Merged-In: fa6a8e97
parent a82d5e7b
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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.
        if (getListView().getItemAnimator() != null) {
            getListView().getItemAnimator().setMoveDuration(0);
        }

        if (mTts == null || mCurrentDefaultLocale == null) {
            return;