Bug 981614 - Do a null check when handling toolbar focus change in HomePager (r=jdover)
authorLucas Rocha <lucasr@mozilla.com>
Tue, 11 Mar 2014 17:58:31 +0000
changeset 191338 e1f1f275f9021b76c20a3b3d5ab09de1a654f4c1
parent 191337 e905debc9d6a9927c724c0798c773b7d953509be
child 191339 f66e3ccb0c419a538cab1200ce16670e31ed007b
push id474
push userasasaki@mozilla.com
push dateMon, 02 Jun 2014 21:01:02 +0000
treeherdermozilla-release@967f4cf1b31c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjdover
bugs981614
milestone30.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 981614 - Do a null check when handling toolbar focus change in HomePager (r=jdover)
mobile/android/base/home/HomePager.java
--- a/mobile/android/base/home/HomePager.java
+++ b/mobile/android/base/home/HomePager.java
@@ -249,16 +249,20 @@ public class HomePager extends ViewPager
         if (mHomeBanner != null) {
             mHomeBanner.handleHomeTouch(event);
         }
 
         return super.dispatchTouchEvent(event);
     }
 
     public void onToolbarFocusChange(boolean hasFocus) {
+        if (mHomeBanner == null) {
+            return;
+        }
+
         // We should only make the banner active if the toolbar is not focused and we are on the default page
         final boolean active = !hasFocus && getCurrentItem() == mDefaultPageIndex;
         mHomeBanner.setActive(active);
     }
 
     private void updateUiFromConfigState(HomeConfig.State configState) {
         // We only care about the adapter if HomePager is currently
         // loaded, which means it's visible in the activity.