fix(android): Update Camera1 to not crash on invalid ratio (#2501)
Setting a property ends up with an unhandled exception that cannot be caught easily by RN. This should also make the behaviour consistent with camera startup and Camera2.
This commit is contained in:
parent
38a5ffb2eb
commit
702f60862e
@ -336,7 +336,7 @@ class Camera1 extends CameraViewImpl implements MediaRecorder.OnInfoListener,
|
||||
} else if (!mAspectRatio.equals(ratio)) {
|
||||
final Set<Size> sizes = mPreviewSizes.sizes(ratio);
|
||||
if (sizes == null) {
|
||||
throw new UnsupportedOperationException(ratio + " is not supported");
|
||||
// do nothing, ratio remains unchanged. Consistent with Camera2 and initial mount behaviour
|
||||
} else {
|
||||
mAspectRatio = ratio;
|
||||
adjustCameraParameters();
|
||||
|
||||
Loading…
Reference in New Issue
Block a user