mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
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:
parent
0dd678f533
commit
73a1752d9c
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user