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

Commit 94449158 authored by Ian Parkinson's avatar Ian Parkinson
Browse files

Avoid NPE from delayed Runnable

Naive fix to b/12656485. Other Runnables in Launcher similarly check
that mWorkspace hasn't become null between being posted and being
executed, so I think this is probably appropriate.

Bug: 12656485
Change-Id: Ib4f3d0e8686c6249fe838144b1e8120c85f66f01
parent a4db090b
Loading
Loading
Loading
Loading
+5 −3
Original line number Diff line number Diff line
@@ -3951,10 +3951,12 @@ public class Launcher extends Activity
                    // when we are loading right after we return to launcher.
                    mWorkspace.postDelayed(new Runnable() {
                        public void run() {
                            if (mWorkspace != null) {
                                mWorkspace.snapToPage(newScreenIndex);
                                mWorkspace.postDelayed(startBounceAnimRunnable,
                                        NEW_APPS_ANIMATION_DELAY);
                            }
                        }
                    }, NEW_APPS_PAGE_MOVE_DELAY);
                } else {
                    mWorkspace.postDelayed(startBounceAnimRunnable, NEW_APPS_ANIMATION_DELAY);