bug 944168 - null pointer when adding tab with GeckoView r=mfinkle
authorBrad Lassey <blassey@mozilla.com>
Wed, 27 Nov 2013 18:27:53 -0500
changeset 159843 2095335b9a65
parent 159842 4204ff8d0234
child 159844 92d8dc924a05
push id25815
push usercbook@mozilla.com
push date2013-12-11 09:16 +0000
treeherdermozilla-central@12ea03a70243 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmfinkle
bugs944168
milestone29.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 944168 - null pointer when adding tab with GeckoView r=mfinkle
mobile/android/base/gfx/LayerRenderer.java
--- a/mobile/android/base/gfx/LayerRenderer.java
+++ b/mobile/android/base/gfx/LayerRenderer.java
@@ -706,13 +706,17 @@ public class LayerRenderer implements Ta
 
     @Override
     public void onTabChanged(final Tab tab, Tabs.TabEvents msg, Object data) {
         // Sets the background of the newly selected tab. This background color
         // gets cleared in endDrawing(). This function runs on the UI thread,
         // but other code that touches the paint state is run on the compositor
         // thread, so this may need to be changed if any problems appear.
         if (msg == Tabs.TabEvents.SELECTED) {
-            mView.getChildAt(0).setBackgroundColor(tab.getBackgroundColor());
-            mView.setPaintState(LayerView.PAINT_START);
+            if (mView != null) {
+                if (mView.getChildAt(0) != null) {
+                    mView.getChildAt(0).setBackgroundColor(tab.getBackgroundColor());
+                }
+                mView.setPaintState(LayerView.PAINT_START);
+            }
         }
     }
 }