Bug 785596 - Guard against null gfx objects during touch event handling. r=sriram

This commit is contained in:
Kartikaya Gupta 2012-08-27 20:34:58 -04:00
parent bdddaf65ac
commit c2e94030a1

View File

@ -13,6 +13,7 @@ import org.mozilla.gecko.gfx.IntSize;
import org.mozilla.gecko.gfx.LayerView;
import org.mozilla.gecko.gfx.RectUtils;
import org.mozilla.gecko.gfx.ScreenshotLayer;
import org.mozilla.gecko.gfx.TouchEventHandler;
import org.mozilla.gecko.mozglue.DirectBufferAllocator;
import org.mozilla.gecko.util.EventDispatcher;
import org.mozilla.gecko.util.FloatUtils;
@ -1502,7 +1503,10 @@ public class GeckoAppShell
getMainHandler().post(new Runnable() {
public void run() {
LayerView view = GeckoApp.mAppContext.getLayerView();
view.getTouchEventHandler().handleEventListenerAction(!defaultPrevented);
TouchEventHandler handler = (view == null ? null : view.getTouchEventHandler());
if (handler != null) {
handler.handleEventListenerAction(!defaultPrevented);
}
}
});
}