зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
dcd4c16f2d
Коммит
1623e470ec
|
@ -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) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче