Bug 818415 - Protect against null layout params when leaving awesome screen (r=mfinkle)
authorLucas Rocha <lucasr@mozilla.com>
Thu, 06 Dec 2012 11:14:08 +0000
changeset 120768 a20b04151df675d356d04a80364365663470269a
parent 120767 4e267b18260baf966d89ae6965b10854e8366185
child 120769 9e21b82f790f54b37686182a98fd9598142cd3fb
push idunknown
push userunknown
push dateunknown
reviewersmfinkle
bugs818415
milestone20.0a1
Bug 818415 - Protect against null layout params when leaving awesome screen (r=mfinkle)
mobile/android/base/BrowserToolbar.java
--- a/mobile/android/base/BrowserToolbar.java
+++ b/mobile/android/base/BrowserToolbar.java
@@ -481,18 +481,20 @@ public class BrowserToolbar implements V
 
                 // Restore the background state
                 MarginLayoutParams barParams = (MarginLayoutParams) mAddressBarBg.getLayoutParams();
                 barParams.rightMargin = mAddressBarBgRightMargin;
                 mAddressBarBg.setCurveTowards(mAddressBarBgCurveTowards);
                 mAddressBarBg.requestLayout();
 
                 // If there are action bar items in the toolbar, we have to restore the
-                // alignment of the entry in relation to them.
-                if (mActionItemBar.getVisibility() == View.VISIBLE)
+                // alignment of the entry in relation to them. mAwesomeBarParams might
+                // be null if the activity holding the toolbar is killed before returning
+                // from awesome screen (e.g. "Don't keep activities" is on)
+                if (mActionItemBar.getVisibility() == View.VISIBLE && mAwesomeBarParams != null)
                     ((View) mAwesomeBar.getParent()).setLayoutParams(mAwesomeBarParams);
 
                 // Hide fake right edge, we only use for the animation
                 mAwesomeBarRightEdge.setVisibility(View.INVISIBLE);
 
                 PropertyAnimator buttonsAnimator = new PropertyAnimator(150);
 
                 // Fade toolbar buttons (reader, stop) after the entry