Bug 781676 - Fix possible NPE from a null mTouchEventHandler. r=sriram a=lsblakk
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 10 Aug 2012 16:16:54 -0400
changeset 102366 487a4d3f98aa7a6fe5c65755273b5fe8ecbbcf1f
parent 102365 824121cfc9ad0ffcf00cf2d5a873e4fdee2e941e
child 102367 8738a36b2a9ed991a16c11e13e7701c5caa40893
push id1892
push userkgupta@mozilla.com
push dateMon, 13 Aug 2012 18:21:02 +0000
treeherdermozilla-aurora@487a4d3f98aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram, lsblakk
bugs781676
milestone16.0a2
Bug 781676 - Fix possible NPE from a null mTouchEventHandler. r=sriram a=lsblakk
mobile/android/base/gfx/LayerView.java
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -82,22 +82,22 @@ public class LayerView extends SurfaceVi
     public boolean onTouchEvent(MotionEvent event) {
         if (event.getActionMasked() == MotionEvent.ACTION_DOWN)
             requestFocus();
 
         /** We need to manually hide FormAssistPopup because it is not a regular PopupWindow. */
         if (GeckoApp.mAppContext != null && GeckoApp.mAppContext.mFormAssistPopup != null)
             GeckoApp.mAppContext.mFormAssistPopup.hide();
 
-        return mTouchEventHandler.handleEvent(event);
+        return mTouchEventHandler == null ? false : mTouchEventHandler.handleEvent(event);
     }
 
     @Override
     public boolean onHoverEvent(MotionEvent event) {
-        return mTouchEventHandler.handleEvent(event);
+        return mTouchEventHandler == null ? false : mTouchEventHandler.handleEvent(event);
     }
 
     public LayerController getController() { return mController; }
     public TouchEventHandler getTouchEventHandler() { return mTouchEventHandler; }
 
     /** The LayerRenderer calls this to indicate that the window has changed size. */
     public void setViewportSize(IntSize size) {
         mController.setViewportSize(new FloatSize(size));