mirror of
https://github.com/zoriya/react-native-svg.git
synced 2026-06-06 16:32:24 +00:00
fix NullPointerException
This commit is contained in:
@@ -100,11 +100,13 @@ public class SvgView extends ViewGroup {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public boolean dispatchTouchEvent(MotionEvent ev) {
|
public boolean dispatchTouchEvent(MotionEvent ev) {
|
||||||
mTargetTag = getShadowNode().hitTest(new Point((int) ev.getX(), (int) ev.getY()));
|
SvgViewShadowNode node = getShadowNode();
|
||||||
|
if (node != null) {
|
||||||
if (mTargetTag != -1) {
|
mTargetTag = node.hitTest(new Point((int) ev.getX(), (int) ev.getY()));
|
||||||
handleTouchEvent(ev);
|
if (mTargetTag != -1) {
|
||||||
return true;
|
handleTouchEvent(ev);
|
||||||
|
return true;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return super.dispatchTouchEvent(ev);
|
return super.dispatchTouchEvent(ev);
|
||||||
|
|||||||
Reference in New Issue
Block a user