Bug 930162: NPE in TabMenuStrip. [r=lucasr, a=lsblakk]
authorSriram Ramasubramanian <sriram@mozilla.com>
Thu, 24 Oct 2013 12:27:49 -0700
changeset 167605 cdd11c4a3224fe4ba0c78c27e6e867acf8e7227b
parent 167604 731470a7c4ca01a0fdbf2bf43802d9053f048794
child 167606 ec081a4840ca07a399158f89c507655305c01d28
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslucasr, lsblakk
bugs930162
milestone27.0a2
Bug 930162: NPE in TabMenuStrip. [r=lucasr, a=lsblakk]
mobile/android/base/home/TabMenuStrip.java
--- a/mobile/android/base/home/TabMenuStrip.java
+++ b/mobile/android/base/home/TabMenuStrip.java
@@ -99,16 +99,20 @@ public class TabMenuStrip extends Linear
     @Override
     public void onPageScrolled(int position, float positionOffset, int positionOffsetPixels) {
         if (mStrip == null) {
             return;
         }
 
         setScrollingData(position, positionOffset);
 
+        if (fromTab == null || toTab == null) {
+            return;
+        }
+
         final int fromTabLeft =  fromTab.getLeft();
         final int fromTabRight = fromTab.getRight();
 
         final int toTabLeft =  toTab.getLeft();
         final int toTabRight = toTab.getRight();
 
         mStrip.setBounds((int) (fromTabLeft + ((toTabLeft - fromTabLeft) * progress)),
                          0,