Bug 703004 - Fix NPE on touch during startup [r=pcwalton]

Fix a couple of places that transform a point but
don't properly deal with the possible null return
value.
This commit is contained in:
Kartikaya Gupta 2011-11-16 13:42:45 -05:00
Родитель dcd4c16f2d
Коммит 1623e470ec
2 изменённых файлов: 6 добавлений и 0 удалений

Просмотреть файл

@ -461,6 +461,9 @@ public class GeckoAppShell
/* Transform the point to the layer offset. */
PointF eventPoint = new PointF(origX, origY);
PointF geckoPoint = layerController.convertViewPointToLayerPoint(eventPoint);
if (geckoPoint == null) {
return false;
}
event.setLocation((int)Math.round(geckoPoint.x), (int)Math.round(geckoPoint.y));
GeckoAppShell.sendEventToGecko(new GeckoEvent(event));

Просмотреть файл

@ -594,6 +594,9 @@ public class PanZoomController
try {
PointF point = new PointF(motionEvent.getX(), motionEvent.getY());
point = mController.convertViewPointToLayerPoint(point);
if (point == null) {
return;
}
ret.put("x", (int)Math.round(point.x));
ret.put("y", (int)Math.round(point.y));
} catch(Exception ex) {