From cde54938707de14310b35f505490d9338ec72e50 Mon Sep 17 00:00:00 2001 From: Oscar Franco Date: Tue, 9 Jan 2018 12:56:58 +0100 Subject: [PATCH] [BUGFIX] Fix crash on empty mFaceDetector instance when face is not recognized --- .../org/reactnative/camera/events/FaceDetectionErrorEvent.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/android/src/main/java/org/reactnative/camera/events/FaceDetectionErrorEvent.java b/android/src/main/java/org/reactnative/camera/events/FaceDetectionErrorEvent.java index 54f43b1..ff1aa60 100644 --- a/android/src/main/java/org/reactnative/camera/events/FaceDetectionErrorEvent.java +++ b/android/src/main/java/org/reactnative/camera/events/FaceDetectionErrorEvent.java @@ -47,7 +47,7 @@ public class FaceDetectionErrorEvent extends Event { private WritableMap serializeEventData() { WritableMap map = Arguments.createMap(); - map.putBoolean("isOperational", mFaceDetector.isOperational()); + map.putBoolean("isOperational", mFaceDetector != null ? mFaceDetector.isOperational() : false); return map; } }