Fix for: Fast swiping and touching while component is being loaded can cause _camera to be null.

This commit is contained in:
Lowie Huyghe
2017-11-07 17:02:48 +01:00
parent 59a0b44c71
commit ca48b33f7f
@@ -359,6 +359,11 @@ class RCTCameraViewFinder extends TextureView implements TextureView.SurfaceText
@Override
public boolean onTouchEvent(MotionEvent event) {
// Fast swiping and touching while component is being loaded can cause _camera to be null.
if (_camera == null) {
return false;
}
// Get the pointer ID
Camera.Parameters params = _camera.getParameters();
int action = event.getAction();