Bug 781676 - Fix possible NPE from a null mTouchEventHandler. r=sriram
authorKartikaya Gupta <kgupta@mozilla.com>
Fri, 10 Aug 2012 16:16:54 -0400
changeset 102147 20299820ca666d39aa692e96d9130d1cde1bc406
parent 102146 683e8441bb24992217183638cc79772f37c2aeb3
child 102148 664ce0cf6f6c58fe7add8d951394fdb464abf8e6
push id23264
push userryanvm@gmail.com
push dateSun, 12 Aug 2012 02:33:48 +0000
treeherdermozilla-central@9d086534903a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssriram
bugs781676
milestone17.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 781676 - Fix possible NPE from a null mTouchEventHandler. r=sriram
mobile/android/base/gfx/LayerView.java
--- a/mobile/android/base/gfx/LayerView.java
+++ b/mobile/android/base/gfx/LayerView.java
@@ -109,22 +109,22 @@ public class LayerView extends FrameLayo
     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.hideFormAssistPopup();
 
-        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 GeckoLayerClient getLayerClient() { return mLayerClient; }
     public TouchEventHandler getTouchEventHandler() { return mTouchEventHandler; }
 
     /** The LayerRenderer calls this to indicate that the window has changed size. */
     public void setViewportSize(IntSize size) {
         mLayerClient.setViewportSize(new FloatSize(size));