mirror of
https://github.com/status-im/react-native-camera.git
synced 2026-08-31 13:41:08 +00:00
Merge pull request #904 from leepa/master
Disallow capture when Camera is null (Android)
This commit is contained in:
@@ -484,6 +484,11 @@ public class RCTCameraModule extends ReactContextBaseJavaModule
|
||||
|
||||
@ReactMethod
|
||||
public void capture(final ReadableMap options, final Promise promise) {
|
||||
if (RCTCamera.getInstance() == null) {
|
||||
promise.reject("Camera is not ready yet.");
|
||||
return;
|
||||
}
|
||||
|
||||
int orientation = options.hasKey("orientation") ? options.getInt("orientation") : RCTCamera.getInstance().getOrientation();
|
||||
if (orientation == RCT_CAMERA_ORIENTATION_AUTO) {
|
||||
_sensorOrientationChecker.onResume();
|
||||
|
||||
Reference in New Issue
Block a user