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